Fix canvas jumping on screen cap
This commit is contained in:
@@ -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 = {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user