Skip to content

Commit

Permalink
include aspectmode changes in relayout updates
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Feb 13, 2020
1 parent 4d24c36 commit c50559a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/plots/gl3d/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ proto.tryCreatePlot = function() {
'webgl setup failed possibly due to',
isMobile ? 'disabling' : 'enabling',
'preserveDrawingBuffer config.',
'The device may not be supported by isMobile module!',
'The device may not be supported by is-mobile module!',
'Inverting preserveDrawingBuffer option in second attempt to create webgl scene.'
].join(' '));
isMobile = opts.glOptions.preserveDrawingBuffer = !opts.glOptions.preserveDrawingBuffer;
Expand Down Expand Up @@ -219,6 +219,12 @@ proto.initializeGLPlot = function() {
if(scene.isAspectChanged(layout)) {
// scene updates
update[scene.id + '.aspectratio'] = scene.glplot.getAspectratio();

if(layout[scene.id].aspectmode !== 'manual') {
scene.fullSceneLayout.aspectmode =
layout[scene.id].aspectmode =
update[scene.id + '.aspectmode'] = 'manual';
}
}

return update;
Expand Down Expand Up @@ -246,7 +252,6 @@ proto.initializeGLPlot = function() {
y: s * o.y,
z: s * o.z
});
scene.fullSceneLayout.aspectmode = layout[scene.id].aspectmode = 'manual';
}

relayoutCallback(scene);
Expand Down

0 comments on commit c50559a

Please sign in to comment.