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

Skip to content

Commit 524ce13

Browse files
committed
use camera spec of own scene to init the camera,
- this fixes an to this point undiscovered bug, where the camera position of non-first scenes in multi-scene wasn't set properly.
1 parent 11189ae commit 524ce13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plots/gl3d/scene.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) {
149149
}
150150

151151
if(!scene.camera) {
152-
var cameraData = fullLayout.scene.camera;
152+
var cameraData = scene.fullSceneLayout.camera;
153153
scene.camera = createCamera(scene.container, {
154154
center: [cameraData.center.x, cameraData.center.y, cameraData.center.z],
155155
eye: [cameraData.eye.x, cameraData.eye.y, cameraData.eye.z],
@@ -167,7 +167,6 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) {
167167
scene.recoverContext();
168168
};
169169

170-
171170
scene.glplot.onrender = render.bind(null, scene);
172171

173172
//List of scene objects
@@ -203,6 +202,7 @@ function Scene(options, fullLayout) {
203202

204203
this.fullLayout = fullLayout;
205204
this.id = options.id || 'scene';
205+
this.fullSceneLayout = fullLayout[this.id];
206206

207207
//Saved from last call to plot()
208208
this.plotArgs = [ [], {}, {} ];

0 commit comments

Comments
 (0)