chore: Element center point util (#9298)
All checks were successful
Tests / test (push) Successful in 5m4s

This commit is contained in:
jhanma17dev 2025-04-09 10:04:51 -05:00 committed by GitHub
parent 6fc85022ae
commit dff69e9191
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 49 additions and 78 deletions

View file

@ -4,6 +4,7 @@ import {
LINE_CONFIRM_THRESHOLD,
ROUNDNESS,
invariant,
elementCenterPoint,
} from "@excalidraw/common";
import {
isPoint,
@ -297,7 +298,7 @@ export const aabbForElement = (
midY: element.y + element.height / 2,
};
const center = pointFrom(bbox.midX, bbox.midY);
const center = elementCenterPoint(element);
const [topLeftX, topLeftY] = pointRotateRads(
pointFrom(bbox.minX, bbox.minY),
center,