-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1748 from ag-grid/AG-11700-annotation-move
AG-11700 Add dragging annotations from any line
- Loading branch information
Showing
14 changed files
with
225 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export const Vec2 = { | ||
add, | ||
sub, | ||
equal, | ||
fromOffset, | ||
apply, | ||
required, | ||
}; | ||
|
||
interface Vec2 { | ||
x: number; | ||
y: number; | ||
} | ||
|
||
interface OffsetVec2 { | ||
offsetX: number; | ||
offsetY: number; | ||
} | ||
|
||
function add(a: Vec2, b: Vec2): Vec2 { | ||
return { x: a.x + b.x, y: a.y + b.y }; | ||
} | ||
|
||
function sub(a: Vec2, b: Vec2): Vec2 { | ||
return { x: a.x - b.x, y: a.y - b.y }; | ||
} | ||
|
||
function equal(a: Vec2, b: Vec2): boolean { | ||
return a.x === b.x && a.y === b.y; | ||
} | ||
|
||
function fromOffset(a: OffsetVec2): Vec2 { | ||
return { x: a.offsetX, y: a.offsetY }; | ||
} | ||
|
||
function apply(a: Partial<Vec2>, b: Vec2): Vec2 { | ||
a.x = b.x; | ||
a.y = b.y; | ||
return a as Vec2; | ||
} | ||
|
||
function required(a?: Partial<Vec2>): Vec2 { | ||
return { x: a?.x ?? 0, y: a?.y ?? 0 }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...es/ag-charts-enterprise/src/features/annotations/disjoint-channel/disjointChannelScene.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.