From 24a94c8ac1296d2d28510adf75f29069eab10eab Mon Sep 17 00:00:00 2001 From: wass08 Date: Thu, 29 Jan 2026 12:59:02 +0900 Subject: [PATCH] fix camera --- .../editor/custom-camera-controls.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/editor/components/editor/custom-camera-controls.tsx b/apps/editor/components/editor/custom-camera-controls.tsx index 7d2ddc17..84854413 100644 --- a/apps/editor/components/editor/custom-camera-controls.tsx +++ b/apps/editor/components/editor/custom-camera-controls.tsx @@ -48,21 +48,22 @@ export const CustomCameraControls = () => { }, [currentLevelId]); // Configure mouse buttons based on control mode and camera mode + const cameraMode = useViewer((state) => state.cameraMode); const mouseButtons = useMemo(() => { // Use ZOOM for orthographic camera, DOLLY for perspective camera - // const wheelAction = - // cameraMode === 'orthographic' - // ? CameraControlsImpl.ACTION.ZOOM - // : CameraControlsImpl.ACTION.DOLLY - const wheelAction = CameraControlsImpl.ACTION.DOLLY; + const wheelAction = + cameraMode === 'orthographic' + ? CameraControlsImpl.ACTION.ZOOM + : CameraControlsImpl.ACTION.DOLLY return { left: CameraControlsImpl.ACTION.NONE, middle: CameraControlsImpl.ACTION.SCREEN_PAN, right: CameraControlsImpl.ACTION.ROTATE, wheel: wheelAction, - }; - }, []); + } + }, [cameraMode]); + useEffect(() => { const handleNodeCapture = ({ nodeId }: CameraControlEvent) => { @@ -110,5 +111,8 @@ export const CustomCameraControls = () => { }; }, []); - return ; + return ; };