Fix canvas jumping on screen cap

This commit is contained in:
Kurt Hutten
2021-07-18 19:28:03 +10:00
parent 5a045fd89d
commit b0bdb2c6f6
2 changed files with 1 additions and 3 deletions

View File

@@ -60,7 +60,6 @@ const CaptureButton = ({ canEdit, TheButton, shouldUpdateImage }) => {
}) })
updateCanvasSize(oldSize) updateCanvasSize(oldSize)
} else { } else {
console.log(project?.title)
imgBlob = state.objectData.data imgBlob = state.objectData.data
} }
const config = { const config = {

View File

@@ -36,14 +36,13 @@ function Controls({ onCameraChange, onDragStart, onInit }) {
const { camera, gl } = threeInstance const { camera, gl } = threeInstance
useEffect(() => { useEffect(() => {
onInit(threeInstance) onInit(threeInstance)
}, [])
useEffect(() => {
// init camera position // init camera position
camera.position.x = 200 camera.position.x = 200
camera.position.y = 140 camera.position.y = 140
camera.position.z = 20 camera.position.z = 20
camera.far = 10000 camera.far = 10000
camera.fov = 22.5 // matches default openscad fov camera.fov = 22.5 // matches default openscad fov
camera.updateProjectionMatrix()
// Order matters with Euler rotations // Order matters with Euler rotations
// We want it to rotate around the z or vertical axis first then the x axis to match openscad // We want it to rotate around the z or vertical axis first then the x axis to match openscad