mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-09 19:41:32 +00:00
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:
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) => {
|
||||
|
||||
Reference in new issue
Block a user