Browse Source

PlaneBufferGeometry: Avoid breakage when using a float for *Segments

Mr.doob 10 years ago
parent
commit
a2b0946109
1 changed files with 2 additions and 2 deletions
  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;