Skip to content

Commit 1fdc49c

Browse files
committed
keep track of gl3d scene.aspectmode for modebar buttons
1 parent 20d4b3c commit 1fdc49c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/components/modebar/buttons.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ function handleCamera3d(gd, ev) {
346346
var sceneId = sceneIds[i];
347347
var camera = sceneId + '.camera';
348348
var aspectratio = sceneId + '.aspectratio';
349+
var aspectmode = sceneId + '.aspectmode';
349350
var scene = fullLayout[sceneId]._scene;
350351
var didUpdate;
351352

@@ -365,6 +366,7 @@ function handleCamera3d(gd, ev) {
365366
aobj[aspectratio + '.x'] = scene.viewInitial.aspectratio.x;
366367
aobj[aspectratio + '.y'] = scene.viewInitial.aspectratio.y;
367368
aobj[aspectratio + '.z'] = scene.viewInitial.aspectratio.z;
369+
aobj[aspectmode] = scene.viewInitial.aspectmode;
368370
}
369371
}
370372

src/plots/gl3d/scene.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,9 @@ proto.plot = function(sceneData, fullLayout, layout) {
790790
y: fullSceneLayout.aspectratio.y,
791791
z: fullSceneLayout.aspectratio.z
792792
};
793+
794+
// also keep track of aspectmode here
795+
scene.viewInitial.aspectmode = fullSceneLayout.aspectmode;
793796
}
794797

795798
// Update frame position for multi plots

0 commit comments

Comments
 (0)