Skip to content

Commit

Permalink
keep track of gl3d scene.aspectmode for modebar buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Feb 13, 2020
1 parent 20d4b3c commit 1fdc49c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/modebar/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ function handleCamera3d(gd, ev) {
var sceneId = sceneIds[i];
var camera = sceneId + '.camera';
var aspectratio = sceneId + '.aspectratio';
var aspectmode = sceneId + '.aspectmode';
var scene = fullLayout[sceneId]._scene;
var didUpdate;

Expand All @@ -365,6 +366,7 @@ function handleCamera3d(gd, ev) {
aobj[aspectratio + '.x'] = scene.viewInitial.aspectratio.x;
aobj[aspectratio + '.y'] = scene.viewInitial.aspectratio.y;
aobj[aspectratio + '.z'] = scene.viewInitial.aspectratio.z;
aobj[aspectmode] = scene.viewInitial.aspectmode;
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/plots/gl3d/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,9 @@ proto.plot = function(sceneData, fullLayout, layout) {
y: fullSceneLayout.aspectratio.y,
z: fullSceneLayout.aspectratio.z
};

// also keep track of aspectmode here
scene.viewInitial.aspectmode = fullSceneLayout.aspectmode;
}

// Update frame position for multi plots
Expand Down

0 comments on commit 1fdc49c

Please sign in to comment.