fix(count): redraw only app-edited table blocks; recolour count mode in place

- refresh_table_block no longer runs for every table change: only tables
  whose picture reference this app dropped while editing them (and new
  tables without one), never on appearance-only bumps. Moved, restyled or
  freshly opened tables keep their authored *T block. TABLE edits now drop
  the picture reference like the other table edit paths.
- set_count_display recolours just the handles whose count class changed
  (restyle path + recolor_meshes_for_handles); only entering or leaving
  count mode rebuilds the whole drawing.
- Count colouring keeps insert instancing: counted and duplicate wires get
  their own instance groups instead of dropping render_instance.
- The hatch backdrop takes the count colour too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-06 09:33:07 +03:00
1 parent 6da9675c55
commit 8fb4a692c6
3 files changed
+66 -17

No files matched your search

+8
View File
@@ -179,6 +179,8 @@ impl OpenCADStudio {
else {
continue;
};
// `changed` tracks this table while the action runs.
let changed_before = std::mem::take(&mut changed);
match &action {
TableAction::Cell(row, column, text) => {
if let Some(cell) = table.cell_mut(*row, *column) {
@@ -321,6 +323,12 @@ impl OpenCADStudio {
}
_ => {}
}
if changed {
// The stored picture no longer shows the cells: draw
// from them, and redraw the picture.
table.block_record_handle = None;
}
changed |= changed_before;
}
if changed {
self.invalidate_property_targets(i, &selected_handles);