mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: point()
-> pointFrom()
to fix compiler issue (#8578)
This commit is contained in:
parent
0c02972695
commit
b4d8b04d9e
50 changed files with 843 additions and 718 deletions
|
@ -17,7 +17,7 @@ import { arrayToMap } from "../excalidraw/utils";
|
|||
import type { LocalPoint } from "../math";
|
||||
import {
|
||||
rangeIncludesValue,
|
||||
point,
|
||||
pointFrom,
|
||||
pointRotateRads,
|
||||
rangeInclusive,
|
||||
} from "../math";
|
||||
|
@ -36,17 +36,17 @@ const getNonLinearElementRelativePoints = (
|
|||
] => {
|
||||
if (element.type === "diamond") {
|
||||
return [
|
||||
point(element.width / 2, 0),
|
||||
point(element.width, element.height / 2),
|
||||
point(element.width / 2, element.height),
|
||||
point(0, element.height / 2),
|
||||
pointFrom(element.width / 2, 0),
|
||||
pointFrom(element.width, element.height / 2),
|
||||
pointFrom(element.width / 2, element.height),
|
||||
pointFrom(0, element.height / 2),
|
||||
];
|
||||
}
|
||||
return [
|
||||
point(0, 0),
|
||||
point(0 + element.width, 0),
|
||||
point(0 + element.width, element.height),
|
||||
point(0, element.height),
|
||||
pointFrom(0, 0),
|
||||
pointFrom(0 + element.width, 0),
|
||||
pointFrom(0 + element.width, element.height),
|
||||
pointFrom(0, element.height),
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -91,7 +91,7 @@ const getRotatedBBox = (element: NonDeletedExcalidrawElement): Bounds => {
|
|||
const points = getElementRelativePoints(element);
|
||||
|
||||
const { cx, cy } = getMinMaxPoints(points);
|
||||
const centerPoint = point<LocalPoint>(cx, cy);
|
||||
const centerPoint = pointFrom<LocalPoint>(cx, cy);
|
||||
|
||||
const rotatedPoints = points.map((p) =>
|
||||
pointRotateRads(p, centerPoint, element.angle),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue