fix(app): running OSNAP set is app-level, not per-drawing

Modern DWG (R2000+) has no file slot for OSMODE — reading a file left
the header at 0, and adopt_header_sysvars wiped the user's running snap
set on every open. Persist the set (as an $OSMODE-style bitmask) in
settings.json, save it on every snap toggle, and only let a file
override it when it actually carries a nonzero mask (R13/R14 DWG, DXF).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-21 22:00:55 +03:00
1 parent 5ea6a9ac8e
commit ccd1086f9f
4 files changed
+29 -3

No files matched your search

+2
View File
@@ -1548,6 +1548,7 @@ impl OpenCADStudio {
Message::ToggleSnapEnabled => {
self.snapper.toggle_global();
self.sync_vport_display(self.active_tab);
self.persist_settings_if_changed();
Task::none()
}
Message::ToggleGridSnap => {
@@ -2048,6 +2049,7 @@ impl OpenCADStudio {
}
Message::ToggleSnap(t) => {
self.snapper.toggle(t);
self.persist_settings_if_changed();
Task::none()
}
Message::ToggleSnapPopup => {