fix(stretch): re-tessellate stretched entities so the viewport updates (#95)

STRETCH edited geometry directly via document.get_entity_mut, which the
scene's tessellation cache doesn't observe, so the viewport kept showing
the pre-stretch shape until an unrelated redraw. Mark each stretched
entity dirty and bump geometry on completion, matching MOVE's
transform_entities path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-14 00:36:17 +03:00
commit bc92590725

View file

@ -1118,10 +1118,18 @@ impl OpenCADStudio {
}
}
if stretched {
self.tabs[i].scene.mark_entity_dirty(*handle);
count += 1;
}
}
// Geometry was edited in place via get_entity_mut, which the
// scene's tessellation cache doesn't observe. Re-tessellate the
// moved entities so the viewport reflects the stretch right away
// instead of only on the next unrelated redraw. See #95.
if count > 0 {
self.tabs[i].scene.bump_geometry_no_blocks();
}
self.tabs[i].dirty = true;
self.tabs[i].active_cmd = None;
self.tabs[i].snap_result = None;