More adaptive elbow dongle offset

This commit is contained in:
Mark Tolmacs 2025-04-11 21:08:55 +02:00
parent 1ee3676784
commit a8338cdb5a
3 changed files with 50 additions and 2 deletions

View file

@ -282,6 +282,15 @@ export const mapIntervalToBezierT = <P extends GlobalPoint | LocalPoint>(
);
};
export const aabbForPoints = <Point extends GlobalPoint | LocalPoint>(
points: Point[],
): Bounds => [
Math.min(...points.map((point) => point[0])),
Math.min(...points.map((point) => point[1])),
Math.max(...points.map((point) => point[0])),
Math.max(...points.map((point) => point[1])),
];
/**
* Get the axis-aligned bounding box for a given element
*/