Preferences › Sketch: auto-projection holds across designs (#680) (#959)

Session::replace_design keeps auto_project when file.new, doc.open and doc.recover swap in another design, and the UI keeps it across tabs, adopt and the last-tab close. Regression tests in engine (sketch_project) and ui-egui (documents).
This commit is contained in:
HEOJUNFO authored and GitHub committed 2026-10-13 23:49:51 -04:00
1 parent 4bea4c7785
commit f204042bf2
4 files changed
+68 -6

No files matched your search

+8
View File
@@ -328,6 +328,14 @@ impl Session {
}
}
/// Become `fresh` (another design opened, recovered or started), keeping the settings that
/// are the user's rather than the design's: `auto_project` is a preference (#680).
pub fn replace_design(&mut self, fresh: Session) {
let auto_project = self.auto_project;
*self = fresh;
self.auto_project = auto_project;
}
/// The design has changes not in its file: in the document, or in what is hidden.
pub fn is_dirty(&self) -> bool {
(!Arc::ptr_eq(&self.doc, &self.saved) && *self.doc != *self.saved) || self.visibility != self.saved_visibility