Fix attachment overshoot and semantic trace port geometry

This commit is contained in:
2026-09-22 18:13:07 -07:00
parent 79cc9d5551
commit 3aa80de89c
11 changed files with 348 additions and 18 deletions
+12 -1
View File
@@ -104,10 +104,21 @@ pub fn attachment_from_point(
side,
offset: projection::port_anchor_offset(node, side, cursor),
};
// Measure side intent at the box, not from a distant overshoot: Euclidean
// distance differences converge outside a small symbol and would otherwise
// let hysteresis retain a perpendicular side indefinitely.
let boundary_cursor = pos(
cursor
.x
.clamp(node.position.x, node.position.x + node.size.width),
cursor
.y
.clamp(node.position.y, node.position.y + node.size.height),
);
let distance = |side| {
length(
projection::port_anchor_position(node, side, candidate(side).offset),
cursor,
boundary_cursor,
)
};
let mut side = [