fix(render): repaint on layer/property edits (#231)

Layer color/linetype/lineweight and MATCHPROP edits set the
document dirty flag but never bumped geometry_epoch. The wire
caches key on that epoch and bake a ByLayer entity's resolved
color at tessellation time, so they returned stale wires until
a new entity forced a rebuild. Bump geometry on those four
handlers so the edit repaints immediately.

Also remove REGEN/REGENALL/REDRAW/REDRWALL: the GPU raster
pipeline keeps the display continuously in sync, so on-demand
regen/redraw is a no-op concept in OCS.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-30 23:41:13 +03:00
1 parent a994a148fe
commit f6a7b0885f
6 files changed
+29 -12

No files matched your search

+4
View File
@@ -764,6 +764,10 @@ impl OpenCADStudio {
}
}
self.tabs[i].dirty = true;
// Color / linetype / lineweight are baked into the cached
// wires at tessellation time; bump the geometry epoch so the
// matched objects repaint instead of holding their old look.
self.tabs[i].scene.bump_geometry();
self.refresh_properties();
self.command_line
.push_info(&format!("Properties matched to {} object(s).", dest.len()));
-6
View File
@@ -3,12 +3,6 @@ use super::*;
impl OpenCADStudio {
pub(super) fn dispatch_display(&mut self, cmd: &str, i: usize) -> Option<Task<Message>> {
match cmd {
// ── Display refresh (no-op in GPU raster pipeline) ────────────────
"REGEN" | "REGENALL" | "REDRAW" | "REDRWALL" => {
// Display is always up-to-date in the GPU raster pipeline.
self.command_line.push_output("Display regenerated.");
}
// Interactive pan: left-drag pans the view until Esc. The only pan
// path when there is no middle mouse button (trackpad / web).
"PAN" | "P" => {
-4
View File
@@ -511,10 +511,6 @@ inventory::submit!(crate::command::CommandRegistration {
"QSELECT",
"QUIT",
"REDO",
"REDRAW",
"REDRWALL",
"REGEN",
"REGENALL",
"RENAME",
"REPORT",
"SA",
+8
View File
@@ -964,6 +964,10 @@ impl OpenCADStudio {
pl.color = new_color;
}
self.tabs[i].dirty = true;
// ByLayer color is baked into the cached wires at
// tessellation time, so bump the geometry epoch to
// invalidate the wire cache and repaint with the new color.
self.tabs[i].scene.bump_geometry();
}
self.tabs[i].layers.color_picker_row = None;
self.tabs[i].layers.color_full_palette = false;
@@ -984,6 +988,8 @@ impl OpenCADStudio {
pl.linetype = lt;
}
self.tabs[i].dirty = true;
// Linetype is baked into the cached wires; repaint.
self.tabs[i].scene.bump_geometry();
}
}
Task::none()
@@ -1001,6 +1007,8 @@ impl OpenCADStudio {
pl.lineweight = lw;
}
self.tabs[i].dirty = true;
// Lineweight is baked into the cached wires; repaint.
self.tabs[i].scene.bump_geometry();
}
}
Task::none()