mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Unify on GenericPoint type
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
0c47bd0004
commit
017047d15e
7 changed files with 68 additions and 115 deletions
|
@ -58,7 +58,7 @@ export type GenericPoint = GlobalPoint | LocalPoint | ViewportPoint;
|
|||
/**
|
||||
* A line is an infinitely long object with no width, depth, or curvature.
|
||||
*/
|
||||
export type Line<P extends GlobalPoint | LocalPoint> = [p: P, q: P] & {
|
||||
export type Line<P extends GenericPoint> = [p: P, q: P] & {
|
||||
_brand: "excalimath_line";
|
||||
};
|
||||
|
||||
|
@ -67,10 +67,7 @@ export type Line<P extends GlobalPoint | LocalPoint> = [p: P, q: P] & {
|
|||
* line that is bounded by two distinct end points, and
|
||||
* contains every point on the line that is between its endpoints.
|
||||
*/
|
||||
export type LineSegment<P extends GlobalPoint | LocalPoint | ViewportPoint> = [
|
||||
a: P,
|
||||
b: P,
|
||||
] & {
|
||||
export type LineSegment<P extends GenericPoint> = [a: P, b: P] & {
|
||||
_brand: "excalimath_linesegment";
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue