forked from 1b-agent/opencadstudio-upstream
refactor: make grid visibility per-drawing, not a global setting
Grid on/off now round-trips through the drawing's *Active VPort, so it is a per-file view setting like every other CAD app treats it. Drop show_grid from UserSettings (and its settings.txt key) and instead adopt the opened file's saved grid_on on load. A legacy "grid=" line in an old settings file is harmlessly ignored. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
cd17096f65
commit
b2feeb716b
3 files changed
+17
-7
No files matched your search
@@ -5639,6 +5639,17 @@ impl Scene {
|
||||
}
|
||||
}
|
||||
|
||||
/// Grid visibility stored on the `*Active` VPort entry, applied to the app's
|
||||
/// grid toggle when a file loads (grid is a per-drawing view setting, not a
|
||||
/// global preference). `None` when there is no active entry. (#121)
|
||||
pub fn active_vport_grid_on(&self) -> Option<bool> {
|
||||
self.document
|
||||
.vports
|
||||
.iter()
|
||||
.find(|v| v.name == "*Active")
|
||||
.map(|v| v.grid_on)
|
||||
}
|
||||
|
||||
/// Set the paper-space camera from the sheet viewport's stored view.
|
||||
/// Returns true if a valid sheet viewport was found and the camera was set.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user