Sketch: preview the whole midpoint line while drawing it (#1371)

The Midpoint Line tool previews the line from the cursor's mirror image through the middle to the cursor, which is what the second click commits. Fixes #1358.
This commit is contained in:
DuBearte authored and GitHub committed 2026-10-15 08:22:42 -04:00
1 parent 4dc638109b
commit 56622e4be8
2 files changed
+10

No files matched your search

+8
View File
@@ -586,6 +586,14 @@ pub(crate) fn preview_curve(t: &Tool, hover: Vec2, sweep: Option<f64>, rho: Opti
("sketch.circle.two_point", [a]) => {
sk.add_circle((*a + hover) * 0.5, a.dist(hover) * 0.5, None, None).ok()?;
}
// The first click is the middle: the line runs from the cursor's mirror image through
// it to the cursor (#1358), not from the middle to the cursor.
("sketch.line.midpoint", [m]) => {
if m.dist(hover) <= 1e-9 {
return None;
}
sk.add_line(*m * 2.0 - hover, hover, None, None, None).ok()?;
}
("sketch.circle.three_point" | "sketch.arc.three_point", [a, b]) => {
let ab = *b - *a;
let ah = hover - *a;