Explorar o código

PlaneBufferGeometry: Avoid breakage when using a float for *Segments

Mr.doob %!s(int64=10) %!d(string=hai) anos
pai
achega
a2b0946109
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/extras/geometries/PlaneBufferGeometry.js

+ 2 - 2
src/extras/geometries/PlaneBufferGeometry.js

@@ -19,8 +19,8 @@ THREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegme
 	var width_half = width / 2;
 	var height_half = height / 2;
 
-	var gridX = widthSegments || 1;
-	var gridY = heightSegments || 1;
+	var gridX = Math.floor( widthSegments ) || 1;
+	var gridY = Math.floor( heightSegments ) || 1;
 
 	var gridX1 = gridX + 1;
 	var gridY1 = gridY + 1;