fix(edit): grip edits drop a dimension's stale baked *D block (#398)
A reopened file renders dimensions from the *D block baked on save, so grip drags only moved definition points while the stale block kept drawing — grips worked on fresh dimensions but died after a roundtrip. Route the grip drag, grip-menu actions and typed grip-menu values through invalidate_dim_block (#181) so tessellation falls back to live geometry and the next save re-bakes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
7811add666
commit
5ea6a9ac8e
2 changed files with 17 additions and 0 deletions
|
|
@ -165,6 +165,12 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
|||
{
|
||||
entity.apply_grip_menu_value(pending.grip_id, pending.action, v);
|
||||
}
|
||||
// A typed grip-menu value reshapes dimensions too — drop a
|
||||
// stale baked *D block (no-op for non-dims). (#398)
|
||||
crate::modules::draw::modify::explode::invalidate_dim_block(
|
||||
&mut self.tabs[i].scene.document,
|
||||
pending.handle,
|
||||
);
|
||||
self.tabs[i].scene.bump_geometry();
|
||||
self.tabs[i].dirty = true;
|
||||
self.refresh_selected_grips();
|
||||
|
|
@ -950,6 +956,12 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
|||
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(popup.handle) {
|
||||
entity.apply_grip_menu(popup.grip_id, item.action);
|
||||
}
|
||||
// Menu actions reshape dimensions too — drop a stale baked *D
|
||||
// block so the edit is visible (no-op for non-dims). (#398)
|
||||
crate::modules::draw::modify::explode::invalidate_dim_block(
|
||||
&mut self.tabs[i].scene.document,
|
||||
popup.handle,
|
||||
);
|
||||
self.tabs[i].scene.bump_geometry();
|
||||
self.tabs[i].dirty = true;
|
||||
self.refresh_selected_grips();
|
||||
|
|
|
|||
|
|
@ -391,6 +391,11 @@ impl Scene {
|
|||
if let Some(entity) = self.document.get_entity_mut(handle) {
|
||||
view::dispatch::apply_grip(entity, grip_id, apply);
|
||||
}
|
||||
// A dimension loaded from a file renders through its baked *D block;
|
||||
// the grip only moved a definition point, so the baked graphics are
|
||||
// stale — drop them so tessellation falls back to the live geometry
|
||||
// and the next save re-bakes (no-op for non-dimensions). (#398)
|
||||
crate::modules::draw::modify::explode::invalidate_dim_block(&mut self.document, handle);
|
||||
|
||||
// Translate MeshModel vertices by the same delta the grip applied.
|
||||
if let Some(old) = old_por {
|
||||
|
|
|
|||
Loading…
Reference in a new issue