forked from 1b-agent/opencadstudio-upstream
perf(scene): grip drag previews the entity instead of re-tessellating
Phase 2.2 (partial). Dragging an entity's grip called scene.apply_grip on every mouse move, which bumped geometry and re-tessellated the whole model per move (plus an O(N) clone of every wire to exclude the edited one from snapping). On a large drawing that's the 30ms->400ms spike, per frame, for the duration of the drag. apply_grip no longer bumps. The drag flow now: - first move: hide the edited entity from the base tessellation (one re-tess) and record it in grip_preview_handle; - each move: apply the grip to the doc (no bump) and show the entity as a one-entity overlay preview (set_preview_wires) — the base is a cache hit; - commit on release / Esc: un-hide, drop the preview, one final re-tess. Because the edited entity is hidden, it's already absent from hit_test_wires, so snapping runs against the cached set directly — no per-move clone and no self-snap. Two re-tessellations per drag instead of one per move. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
ccb9bb832d
commit
8df9bef6f8
4 files changed
+57
-8
No files matched your search
+4
-1
@@ -4890,7 +4890,10 @@ impl Scene {
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
self.bump_geometry();
|
||||
// NOTE: no `bump_geometry()` here. The grip-drag caller hides the
|
||||
// edited entity and previews it as an overlay during the drag (so a
|
||||
// move doesn't re-tessellate the whole model), then bumps once on
|
||||
// commit. Any other caller must bump geometry itself.
|
||||
}
|
||||
|
||||
// ── Hit-test convenience: wire name → Handle ──────────────────────────
|
||||
|
||||
Reference in new issue
Block a user