revert: drop PLOTWINDOW forced endpoint snap (#293)

Remove the forces_endpoint_snap mechanism merged in #293:
CadCommand::forces_endpoint_snap, Snapper::snap_forced_corners /
forced_corner_modes, the PlotWindowCommand override, the on_tick +
click-commit wiring, and the associated tests. PLOTWINDOW now uses the
normal snapper like every other command.

Rationale: forcing Endpoint snap on regardless of the global OSNAP master
overrides an explicit user setting and is surprising — a plot window is a
coarse print region that usually wants a margin, not a corner lock, and
the forced set only caught Endpoint (not center/mid/intersection) so it
was a partial, opinionated helper. Parking it pending a design discussion
with the PR author; can be reinstated behind a clearer UX (e.g. respecting
OSNAP, or an opt-in modifier) if justified.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-06 20:35:50 +03:00
1 parent cb41910f12
commit 9490c85b32
4 files changed
+3 -138

No files matched your search

+3 -30
View File
@@ -889,19 +889,8 @@ pub(super) fn on_tick(&mut self, t: Instant) -> Task<Message> {
} else {
let (go, gr) = self.tabs[i].ucs_grid_basis();
self.snapper.from_point = self.last_point;
let force_corners = self.tabs[i]
.active_cmd
.as_ref()
.map(|c| c.forces_endpoint_snap())
.unwrap_or(false);
if force_corners {
self.snapper.snap_forced_corners(
snap_cursor, p, &all_wires[..], view_rot, eye, bounds, go, gr,
)
} else {
self.snapper
.snap(snap_cursor, p, &all_wires[..], view_rot, eye, bounds, go, gr)
}
self.snapper
.snap(snap_cursor, p, &all_wires[..], view_rot, eye, bounds, go, gr)
};
// Object Snap Tracking: update dwell, then align the cursor
@@ -1828,23 +1817,7 @@ pub(super) fn on_tick(&mut self, t: Instant) -> Task<Message> {
} else {
let (go, gr) = self.tabs[i].ucs_grid_basis();
self.snapper.from_point = self.last_point;
// Mirror the preview path (see on_tick): a command that
// forces corner snap (PLOTWINDOW) must commit the forced
// Endpoint hit, not a plain snap — otherwise the marker
// promises an endpoint the click places at the raw cursor
// whenever the global OSNAP master (or Endpoint mode) is off.
let force_corners = self.tabs[i]
.active_cmd
.as_ref()
.map(|c| c.forces_endpoint_snap())
.unwrap_or(false);
if force_corners {
self.snapper.snap_forced_corners(
snap_cursor, p, &all_wires[..], view_rot, eye, bounds, go, gr,
)
} else {
self.snapper.snap(snap_cursor, p, &all_wires[..], view_rot, eye, bounds, go, gr)
}
self.snapper.snap(snap_cursor, p, &all_wires[..], view_rot, eye, bounds, go, gr)
};
// Snap runs in model space; the result is already model.
let mut pt = snap_hit.map(|s| s.world).unwrap_or(raw);