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 <noreply@anthropic.com>
This commit is contained in:
parent
4d8ea95974
commit
cdd72c62ca
1 changed files with 8 additions and 2 deletions
|
|
@ -1475,9 +1475,15 @@ impl DynInputCanvas {
|
||||||
let center = match b.role {
|
let center = match b.role {
|
||||||
DynRole::Angle => {
|
DynRole::Angle => {
|
||||||
let a_mid = a_ref + sweep * 0.5;
|
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 {
|
Point {
|
||||||
x: base.x + a_mid.cos() * len,
|
x: base.x + a_mid.cos() * r - nx * 18.0,
|
||||||
y: base.y + a_mid.sin() * len,
|
y: base.y + a_mid.sin() * r - ny * 18.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DynRole::X | DynRole::Width => Point {
|
DynRole::X | DynRole::Width => Point {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue