forked from 1b-agent/opencadstudio-upstream
Rebuild a table's block after an edit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4239174f8c
commit
470d6a6b7f
3 files changed
+15
-2
No files matched your search
@@ -3624,6 +3624,19 @@ impl Scene {
|
||||
}
|
||||
}
|
||||
}
|
||||
// An edited table lets go of its block; rebuild it from the cells so
|
||||
// the drawing shows and saves the cell texts and grid it now holds.
|
||||
let mut rebuilt_table_block = false;
|
||||
for (handle, kind) in &changes {
|
||||
if !matches!(kind, ChangeKind::Removed)
|
||||
&& matches!(self.document.get_entity(*handle), Some(EntityType::Table(t)) if t.block_record_handle.is_none())
|
||||
{
|
||||
rebuilt_table_block |= self.document.refresh_table_block(*handle);
|
||||
}
|
||||
}
|
||||
if rebuilt_table_block {
|
||||
self.block_epoch = GEOMETRY_EPOCH.fetch_add(1, Ordering::Relaxed);
|
||||
}
|
||||
if !changes.is_empty() {
|
||||
self.refresh_dependency_index_for_changes(&changes);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user