mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: Update generic constraint Point to use GenericPoint
- Changed existing generic constraints that used LocalPoint | GlobalPoint as Point to now use the unified GenericPoint type.
This commit is contained in:
parent
71e55dba9f
commit
85cb973936
21 changed files with 153 additions and 211 deletions
|
@ -9,6 +9,7 @@ import {
|
|||
vectorCross,
|
||||
vectorFromPoint,
|
||||
vectorScale,
|
||||
type GenericPoint,
|
||||
type GlobalPoint,
|
||||
type LocalPoint,
|
||||
} from "@excalidraw/math";
|
||||
|
@ -1642,7 +1643,7 @@ const pathTo = (start: Node, node: Node) => {
|
|||
return path;
|
||||
};
|
||||
|
||||
const m_dist = (a: GlobalPoint | LocalPoint, b: GlobalPoint | LocalPoint) =>
|
||||
const m_dist = (a: GenericPoint, b: GenericPoint) =>
|
||||
Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);
|
||||
|
||||
/**
|
||||
|
@ -2291,7 +2292,7 @@ const getHoveredElement = (
|
|||
const gridAddressesEqual = (a: GridAddress, b: GridAddress): boolean =>
|
||||
a[0] === b[0] && a[1] === b[1];
|
||||
|
||||
export const validateElbowPoints = <P extends GlobalPoint | LocalPoint>(
|
||||
export const validateElbowPoints = <P extends GenericPoint>(
|
||||
points: readonly P[],
|
||||
tolerance: number = DEDUP_TRESHOLD,
|
||||
) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue