forked from 1b-agent/opencadstudio-upstream
fix(undo): grip-drag history entry + mid-command Ctrl+Z steps (#332)
Grip drags mutated the document without ever pushing history — dragging a polyline vertex (or any grip) could not be undone. The release-commit now swaps the pre-drag backup in, snapshots that PRE state as a "GRIP" entry, swaps the dragged result back and clears the redo stack; the Esc-cancel path is unchanged and a no-move engaging click records nothing. Ctrl+Z during a drawing command steps the command instead of the document undo swallowing the in-progress object (which also killed the active command): new CadCommand::on_undo_step hook, consulted before undo_active_tab. PLINE pops its last vertex (shared with the U option), LINE reverts the last committed segment and keeps drawing from the previous point (rides its existing U/UndoDocument path), and ARC Continue reverts the last arc and resumes from the prior anchor with the correct tangent via a new anchor history. With nothing placed yet each falls through to the document undo. Also drops the two warnings the #336 work left behind (unused Entity import, dead Snapper::override_active). Closes #332 Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
9b40881ab1
commit
9b28170d4b
8 files changed
+109
-34
No files matched your search
@@ -205,9 +205,6 @@ impl Snapper {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn override_active(&self) -> bool {
|
||||
self.override_saved.is_some()
|
||||
}
|
||||
|
||||
/// Whether temporary tracking points are being acquired and drawn: OTRACK
|
||||
/// on, or the Extension object snap on. Extension tracks a segment's line
|
||||
|
||||
Reference in new issue
Block a user