fix(dyn): keep angle input box clear of the snap point near 0°

The DYN angle box was placed at full cursor radius along the mid-angle
direction. With a near-zero sweep that direction collapses onto the
cursor ray, planting the box on top of the cursor / snap point and
hiding it. Pull the box back along the ray and offset it to the side
opposite the distance box so the snap point stays visible. (#124)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-18 20:45:04 +03:00
1 parent 4d8ea95974
commit cdd72c62ca
1 file changed
+8 -2
+8 -2
View File
@@ -1475,9 +1475,15 @@ impl DynInputCanvas {
let center = match b.role {
DynRole::Angle => {
let a_mid = a_ref + sweep * 0.5;
// Pull the box back along the ray and lift it to the side
// opposite the distance box. A near-zero sweep collapses the
// mid-angle direction onto the cursor ray, so placing the box
// at full `len` would plant it on the cursor / snap point and
// hide it. (#124)
let r = (len - DYN_BOX_H * 2.0).max(len * 0.5);
Point {
x: base.x + a_mid.cos() * len,
y: base.y + a_mid.sin() * len,
x: base.x + a_mid.cos() * r - nx * 18.0,
y: base.y + a_mid.sin() * r - ny * 18.0,
}
}
DynRole::X | DynRole::Width => Point {