PageScene: route viewport pointerup through sceneManager

useViewportPointer.onPointerUp called editor.mouse_controls.onMouseUp
directly. That ran the interaction state machine (gizmo end, FK toggle,
selection click) but skipped editor.sceneManager.onMouseUp, which is
the only thing that calls check_scene_for_updates. Result: transform,
deletion, and userdata edits (color, lock, visibility) never made it
into the undo stack, so Ctrl+Z found nothing to undo.

Pre-refactor, SceneManager.attachEventListeners attached a window-level
mouseup that went through SceneManager.onMouseUp; the canvas-scoped
hook lost the same pass-through. Calling sceneManager.onMouseUp here
preserves all the mouse_controls behavior (it forwards internally) and
restores the post-mouseup undo capture.
This commit is contained in:
Tanish Manku committed 2026-05-01 01:22:14 -07:00
1 parent aff4a5616e
commit 6721d2ded8
1 file changed
+4 -1
@@ -43,7 +43,10 @@ export const useViewportPointer = (
};
const onPointerUp = (e: PointerEvent) => {
editor.mouse_controls?.onMouseUp(e);
// Route through sceneManager so check_scene_for_updates fires and
// transforms / deletions / userdata edits get pushed onto the undo
// stack. mouse_controls.onMouseUp is invoked from inside.
editor.sceneManager?.onMouseUp(e as unknown as MouseEvent);
};
const onClick = (_e: MouseEvent) => {