perf(scene): make geometry edits incremental

Avoid full document, cache, and GPU rebuilds for entity deltas so add, delete, history, selection, and live polyline edits stay responsive on large drawings.
This commit is contained in:
Hakan Seven 2026-07-28 17:16:27 +03:00
commit 05b044f367
32 changed files with 1929 additions and 509 deletions

View file

@ -1965,15 +1965,14 @@ impl OpenCADStudio {
Ok(new_handle) => {
if self.tabs[i].scene.is_recording_undo() {
self.tabs[i].scene.record_undo_before(new_handle, None);
self.tabs[i].scene.poison_undo_recording();
}
self.tabs[i].scene.auto_fit_viewport(new_handle);
// Adding a viewport straight onto the document layout
// bypasses Scene::add_entity, which is what normally
// invalidates the wire-tessellation cache. Without this the
// new viewport's border isn't tessellated until the next
// zoom/pan forces a rebuild.
self.tabs[i].scene.bump_geometry_no_blocks();
// bypasses Scene::add_entity; publish the exact new handle
// so only its border is tessellated.
self.tabs[i]
.scene
.bump_entities(&[(new_handle, crate::scene::ChangeKind::Added)]);
Some(new_handle)
}
Err(e) => {