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

Skip to content

Commit c50559a

Browse files
committed
include aspectmode changes in relayout updates
1 parent 4d24c36 commit c50559a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/plots/gl3d/scene.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ proto.tryCreatePlot = function() {
155155
'webgl setup failed possibly due to',
156156
isMobile ? 'disabling' : 'enabling',
157157
'preserveDrawingBuffer config.',
158-
'The device may not be supported by isMobile module!',
158+
'The device may not be supported by is-mobile module!',
159159
'Inverting preserveDrawingBuffer option in second attempt to create webgl scene.'
160160
].join(' '));
161161
isMobile = opts.glOptions.preserveDrawingBuffer = !opts.glOptions.preserveDrawingBuffer;
@@ -219,6 +219,12 @@ proto.initializeGLPlot = function() {
219219
if(scene.isAspectChanged(layout)) {
220220
// scene updates
221221
update[scene.id + '.aspectratio'] = scene.glplot.getAspectratio();
222+
223+
if(layout[scene.id].aspectmode !== 'manual') {
224+
scene.fullSceneLayout.aspectmode =
225+
layout[scene.id].aspectmode =
226+
update[scene.id + '.aspectmode'] = 'manual';
227+
}
222228
}
223229

224230
return update;
@@ -246,7 +252,6 @@ proto.initializeGLPlot = function() {
246252
y: s * o.y,
247253
z: s * o.z
248254
});
249-
scene.fullSceneLayout.aspectmode = layout[scene.id].aspectmode = 'manual';
250255
}
251256

252257
relayoutCallback(scene);

0 commit comments

Comments
 (0)