@@ -725,6 +725,10 @@ proto.plot = function(sceneData, fullLayout, layout) {
725
725
} ) ;
726
726
}
727
727
728
+ /*
729
+ * Dynamically set the aspect ratio depending on the users aspect settings
730
+ */
731
+ var aspectRatio ;
728
732
var aspectmode = fullSceneLayout . aspectmode ;
729
733
var axesScaleRatio ;
730
734
if ( aspectmode === 'auto' || aspectmode === 'data' ) {
@@ -739,11 +743,12 @@ proto.plot = function(sceneData, fullLayout, layout) {
739
743
}
740
744
}
741
745
742
- /*
743
- * Dynamically set the aspect ratio depending on the users aspect settings
744
- */
745
- var aspectRatio ;
746
- if ( aspectmode === 'auto' ) {
746
+ if ( aspectmode === 'cube' ) {
747
+ aspectRatio = [ 1 , 1 , 1 ] ;
748
+ } else if ( aspectmode === 'manual' ) {
749
+ var userRatio = fullSceneLayout . aspectratio ;
750
+ aspectRatio = [ userRatio . x , userRatio . y , userRatio . z ] ;
751
+ } else if ( aspectmode === 'auto' ) {
747
752
var axisAutoScaleFactor = 4 ;
748
753
749
754
if ( Math . max . apply ( null , axesScaleRatio ) / Math . min . apply ( null , axesScaleRatio ) <= axisAutoScaleFactor ) {
@@ -758,13 +763,8 @@ proto.plot = function(sceneData, fullLayout, layout) {
758
763
*/
759
764
aspectRatio = [ 1 , 1 , 1 ] ;
760
765
}
761
- } else if ( aspectmode === 'cube' ) {
762
- aspectRatio = [ 1 , 1 , 1 ] ;
763
766
} else if ( aspectmode === 'data' ) {
764
767
aspectRatio = axesScaleRatio ;
765
- } else if ( aspectmode === 'manual' ) {
766
- var userRatio = fullSceneLayout . aspectratio ;
767
- aspectRatio = [ userRatio . x , userRatio . y , userRatio . z ] ;
768
768
} else {
769
769
throw new Error ( 'scene.js aspectRatio was not one of the enumerated types' ) ;
770
770
}
0 commit comments