mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
Fix zoom not working on with out changing camera mode
This commit is contained in:
parent
94fa1c3ba9
commit
2c7fca94d3
1 changed files with 5 additions and 3 deletions
|
|
@ -19,6 +19,7 @@ export default class Viewer {
|
|||
this.cameraMode$ = externalState(() => this.getCameraMode(), mode => this.setCameraMode(mode))
|
||||
|
||||
this.sceneSetup = new SceneSetUp(container);
|
||||
this.setCameraMode(this.sceneSetup.oCamera);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
@ -49,9 +50,9 @@ export default class Viewer {
|
|||
}
|
||||
|
||||
setCameraMode(mode) {
|
||||
if (this.getCameraMode() === mode) {
|
||||
return;
|
||||
}
|
||||
// if (this.getCameraMode() === mode) {
|
||||
// return;
|
||||
// }
|
||||
if (mode === CAMERA_MODE.PERSPECTIVE) {
|
||||
this.sceneSetup.setCamera(this.sceneSetup.pCamera);
|
||||
} else {
|
||||
|
|
@ -64,6 +65,7 @@ export default class Viewer {
|
|||
}
|
||||
|
||||
toggleCamera() {
|
||||
alert("camera toggled")
|
||||
if (this.getCameraMode() === CAMERA_MODE.PERSPECTIVE) {
|
||||
this.setCameraMode(CAMERA_MODE.ORTHOGRAPHIC);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue