Sfoglia il codice sorgente

Merge pull request #20628 from luna-magicad/orbit-controls-incorrect-theta-clamp

Changed less than to less or equal than for orbit control's theta min…
Mr.doob 4 anni fa
parent
commit
ff60cb599b

+ 1 - 1
examples/js/controls/OrbitControls.js

@@ -173,7 +173,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 				if ( max < - Math.PI ) max += twoPI; else if ( max > Math.PI ) max -= twoPI;
 
-				if ( min < max ) {
+				if ( min <= max ) {
 
 					spherical.theta = Math.max( min, Math.min( max, spherical.theta ) );
 

+ 1 - 1
examples/jsm/controls/OrbitControls.js

@@ -183,7 +183,7 @@ var OrbitControls = function ( object, domElement ) {
 
 				if ( max < - Math.PI ) max += twoPI; else if ( max > Math.PI ) max -= twoPI;
 
-				if ( min < max ) {
+				if ( min <= max ) {
 
 					spherical.theta = Math.max( min, Math.min( max, spherical.theta ) );