@@ -725,6 +725,10 @@ proto.plot = function(sceneData, fullLayout, layout) {
725725 } ) ;
726726 }
727727
728+ /*
729+ * Dynamically set the aspect ratio depending on the users aspect settings
730+ */
731+ var aspectRatio ;
728732 var aspectmode = fullSceneLayout . aspectmode ;
729733 var axesScaleRatio ;
730734 if ( aspectmode === 'auto' || aspectmode === 'data' ) {
@@ -739,11 +743,12 @@ proto.plot = function(sceneData, fullLayout, layout) {
739743 }
740744 }
741745
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' ) {
747752 var axisAutoScaleFactor = 4 ;
748753
749754 if ( Math . max . apply ( null , axesScaleRatio ) / Math . min . apply ( null , axesScaleRatio ) <= axisAutoScaleFactor ) {
@@ -758,13 +763,8 @@ proto.plot = function(sceneData, fullLayout, layout) {
758763 */
759764 aspectRatio = [ 1 , 1 , 1 ] ;
760765 }
761- } else if ( aspectmode === 'cube' ) {
762- aspectRatio = [ 1 , 1 , 1 ] ;
763766 } else if ( aspectmode === 'data' ) {
764767 aspectRatio = axesScaleRatio ;
765- } else if ( aspectmode === 'manual' ) {
766- var userRatio = fullSceneLayout . aspectratio ;
767- aspectRatio = [ userRatio . x , userRatio . y , userRatio . z ] ;
768768 } else {
769769 throw new Error ( 'scene.js aspectRatio was not one of the enumerated types' ) ;
770770 }
0 commit comments