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:
parent
8d6e21ef5f
commit
bc92590725
1 changed files with 8 additions and 0 deletions
|
|
@ -1118,10 +1118,18 @@ impl OpenCADStudio {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if stretched {
|
if stretched {
|
||||||
|
self.tabs[i].scene.mark_entity_dirty(*handle);
|
||||||
count += 1;
|
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].dirty = true;
|
||||||
self.tabs[i].active_cmd = None;
|
self.tabs[i].active_cmd = None;
|
||||||
self.tabs[i].snap_result = None;
|
self.tabs[i].snap_result = None;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue