fix(properties): repaint on linetype/lineweight/layer edits (#231 class)
Color/linetype/lineweight/layer are baked into the cached wire geometry at tessellation time, so a property edit only repaints if the handler bumps the geometry epoch. The color path did; several siblings only set tabs.dirty (a save flag) and never re-tessellated, leaving the viewport showing the stale look. Route every handle-based edit through invalidate_property_targets (mark dirty + recolor meshes + bump geometry), and full-bump the name-based LAYER COLOR change: - ribbon layer / linetype / lineweight dropdowns applied to a selection - CHPROP (color/linetype/ltscale/transparency/layer) - LAYMATCH (MatchEntityLayer) - LAYER COLOR <name> <aci> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
18fff5cf8c
commit
7f3ebde663
5 changed files with 30 additions and 5 deletions
|
|
@ -977,14 +977,18 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
|||
self.tabs[i].dirty = true;
|
||||
self.ribbon.active_layer = layer;
|
||||
} else {
|
||||
// Apply to selection; leave the creation default alone
|
||||
// (matches AutoCAD; "Make current" is a separate action).
|
||||
// Apply to the selection; leave the creation default alone
|
||||
// ("Make current" is a separate action).
|
||||
self.push_undo_snapshot(i, "CHPROP");
|
||||
for handle in handles {
|
||||
for &handle in &handles {
|
||||
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
|
||||
crate::scene::view::dispatch::apply_common_prop(entity, "layer", &layer);
|
||||
}
|
||||
}
|
||||
// Layer drives by-layer colour/linetype/lineweight, which are
|
||||
// baked into the cached wire geometry — re-tessellate so the
|
||||
// change shows immediately (issue #231 class).
|
||||
self.invalidate_property_targets(i, &handles);
|
||||
self.tabs[i].dirty = true;
|
||||
self.ribbon.active_layer = layer;
|
||||
self.refresh_properties();
|
||||
|
|
@ -1041,11 +1045,15 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
|||
self.ribbon.active_linetype = lt;
|
||||
} else {
|
||||
self.push_undo_snapshot(i, "CHPROP");
|
||||
for handle in handles {
|
||||
for &handle in &handles {
|
||||
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
|
||||
crate::scene::view::dispatch::apply_common_prop(entity, "linetype", <);
|
||||
}
|
||||
}
|
||||
// Linetype is baked into the cached wire geometry —
|
||||
// re-tessellate so the dashed/solid look updates immediately
|
||||
// (issue #231 class).
|
||||
self.invalidate_property_targets(i, &handles);
|
||||
self.tabs[i].dirty = true;
|
||||
self.ribbon.active_linetype = lt;
|
||||
self.refresh_properties();
|
||||
|
|
|
|||
Loading…
Reference in a new issue