forked from 1b-agent/opencadstudio-upstream
fix(linetype): an opened drawing keeps exactly its own linetypes (#1826)
Opening a drawing added all 50 catalog linetypes to it, so PURGE found and removed them again after every save and reopen. Opening now only repairs the catalog linetypes a drawing already has. The linetype pickers (layers, properties, ribbon, attribute editor, layer states) offer the missing catalog ones after the drawing's own, and the one picked, or named in LINETYPE SET, is loaded on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c499ce97d4
commit
9a567d4f44
7 files changed
+85
-5
No files matched your search
@@ -2315,7 +2315,7 @@ impl OpenCADStudio {
|
||||
// not inherit the previous tab's filter, and persisted entity
|
||||
// visibility remains independent (not an isolation session).
|
||||
self.tabs[i].scene.reset_transient_visibility();
|
||||
crate::io::linetypes::populate_document(&mut self.tabs[i].scene.document);
|
||||
crate::io::linetypes::repair_document(&mut self.tabs[i].scene.document);
|
||||
self.tabs[i].properties = PropertiesPanel::empty();
|
||||
// Seed the current table / multileader style from the file's
|
||||
// header so the ✓ marks the right one (text/dim/mline come from
|
||||
|
||||
@@ -389,6 +389,20 @@ impl OpenCADStudio {
|
||||
// creating or closing a tab), the contextual ribbon tab follows that
|
||||
// document's selection.
|
||||
let before = self.tabs.get(self.active_tab).map(|tab| tab.id);
|
||||
// Pickers offer the catalog linetypes the drawing lacks; the one
|
||||
// picked is loaded before it is assigned.
|
||||
if let Message::LayerLinetypeSet(name)
|
||||
| Message::LayerStateEditorLayerLinetype(_, name)
|
||||
| Message::RibbonLinetypeChanged(name)
|
||||
| Message::PropLinetypeChanged(name)
|
||||
| Message::AttrEditorLinetype(name) = &msg
|
||||
{
|
||||
if let Some(tab) = self.tabs.get_mut(self.active_tab) {
|
||||
if crate::io::linetypes::ensure_catalog_linetype(&mut tab.scene.document, name) {
|
||||
tab.scene.bump_geometry();
|
||||
}
|
||||
}
|
||||
}
|
||||
let task = self.update_message(msg);
|
||||
self.restore_dynamic_ucs_after_command();
|
||||
self.sync_block_visibility_display();
|
||||
|
||||
Reference in new issue
Block a user