visual feedback on labels belonging to arrows and vice-versa

This commit is contained in:
Joeri Exelmans 2025-10-06 11:45:42 +02:00
parent db246ccefe
commit 58a75ddd8b
5 changed files with 103 additions and 14 deletions

View file

@ -133,7 +133,8 @@ export function intersectLines(a: Line2D, b: Line2D): Vec2D | null {
export function euclideanDistance(a: Vec2D, b: Vec2D): number {
const diffX = a.x - b.x;
const diffY = a.y - b.y;
return Math.sqrt(diffX*diffX + diffY*diffY);
return Math.hypot(diffX, diffY);
// return Math.sqrt(diffX*diffX + diffY*diffY);
}
export function getLeftSide(rect: Rect2D): Line2D {