Skip to content

Commit a028e10

Browse files
committed
declare aspectmode variable
1 parent 9e864a5 commit a028e10

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/plots/gl3d/scene.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,8 @@ proto.plot = function(sceneData, fullLayout, layout) {
725725
});
726726
}
727727

728+
var aspectmode = fullSceneLayout.aspectmode;
729+
728730
var axesScaleRatio = [1, 1, 1];
729731

730732
// Compute axis scale per category
@@ -741,7 +743,7 @@ proto.plot = function(sceneData, fullLayout, layout) {
741743
var axisAutoScaleFactor = 4;
742744
var aspectRatio;
743745

744-
if(fullSceneLayout.aspectmode === 'auto') {
746+
if(aspectmode === 'auto') {
745747
if(Math.max.apply(null, axesScaleRatio) / Math.min.apply(null, axesScaleRatio) <= axisAutoScaleFactor) {
746748
/*
747749
* USE DATA MODE WHEN AXIS RANGE DIMENSIONS ARE RELATIVELY EQUAL
@@ -754,11 +756,11 @@ proto.plot = function(sceneData, fullLayout, layout) {
754756
*/
755757
aspectRatio = [1, 1, 1];
756758
}
757-
} else if(fullSceneLayout.aspectmode === 'cube') {
759+
} else if(aspectmode === 'cube') {
758760
aspectRatio = [1, 1, 1];
759-
} else if(fullSceneLayout.aspectmode === 'data') {
761+
} else if(aspectmode === 'data') {
760762
aspectRatio = axesScaleRatio;
761-
} else if(fullSceneLayout.aspectmode === 'manual') {
763+
} else if(aspectmode === 'manual') {
762764
var userRatio = fullSceneLayout.aspectratio;
763765
aspectRatio = [userRatio.x, userRatio.y, userRatio.z];
764766
} else {

0 commit comments

Comments
 (0)