From b0bdb2c6f6143c798c5e99b746b08f77453d1df0 Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Sun, 18 Jul 2021 19:28:03 +1000 Subject: [PATCH] Fix canvas jumping on screen cap --- app/web/src/components/CaptureButton/CaptureButton.tsx | 1 - app/web/src/components/IdeViewer/IdeViewer.tsx | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/web/src/components/CaptureButton/CaptureButton.tsx b/app/web/src/components/CaptureButton/CaptureButton.tsx index c0b66ce..213bb6d 100644 --- a/app/web/src/components/CaptureButton/CaptureButton.tsx +++ b/app/web/src/components/CaptureButton/CaptureButton.tsx @@ -60,7 +60,6 @@ const CaptureButton = ({ canEdit, TheButton, shouldUpdateImage }) => { }) updateCanvasSize(oldSize) } else { - console.log(project?.title) imgBlob = state.objectData.data } const config = { diff --git a/app/web/src/components/IdeViewer/IdeViewer.tsx b/app/web/src/components/IdeViewer/IdeViewer.tsx index 38b24b9..85675b6 100644 --- a/app/web/src/components/IdeViewer/IdeViewer.tsx +++ b/app/web/src/components/IdeViewer/IdeViewer.tsx @@ -36,14 +36,13 @@ function Controls({ onCameraChange, onDragStart, onInit }) { const { camera, gl } = threeInstance useEffect(() => { onInit(threeInstance) - }, []) - useEffect(() => { // init camera position camera.position.x = 200 camera.position.y = 140 camera.position.z = 20 camera.far = 10000 camera.fov = 22.5 // matches default openscad fov + camera.updateProjectionMatrix() // Order matters with Euler rotations // We want it to rotate around the z or vertical axis first then the x axis to match openscad