Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e97fc78

Browse files
committed
handle cases without camera.projection
1 parent 43e4a04 commit e97fc78

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/plots/gl3d/scene.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ var proto = Scene.prototype;
350350
proto.initializeGLCamera = function() {
351351

352352
var cameraData = this.fullSceneLayout.camera;
353-
var ortho = (cameraData.projection.type === 'orthographic');
353+
var ortho = (cameraData.projection && cameraData.projection.type === 'orthographic');
354354

355355
this.camera = createCamera(this.container, {
356356
center: [cameraData.center.x, cameraData.center.y, cameraData.center.z],
@@ -791,7 +791,13 @@ proto.saveCamera = function saveCamera(layout) {
791791
}
792792
}
793793
}
794-
if(cameraData.projection.type !== cameraDataLastSave.projection.type) hasChanged = true;
794+
795+
if(!cameraDataLastSave.projection || (
796+
cameraData.projection &&
797+
cameraData.projection.type !== cameraDataLastSave.projection.type)) {
798+
799+
hasChanged = true;
800+
}
795801
}
796802

797803
if(hasChanged) {

0 commit comments

Comments
 (0)