Browse Source

SoftwareRenderer: Workaround for avoiding drawing outside the buffer.

Mr.doob 12 years ago
parent
commit
23fa97939b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/js/renderers/SoftwareRenderer.js

+ 2 - 2
examples/js/renderers/SoftwareRenderer.js

@@ -40,8 +40,8 @@ THREE.SoftwareRenderer = function () {
 
 	this.setSize = function ( width, height ) {
 
-		canvasWidth = width | 0;
-		canvasHeight = height | 0;
+		canvasWidth = Math.floor( width / blocksize ) * blocksize;
+		canvasHeight = Math.floor( height / blocksize ) * blocksize;
 
 		canvasWidthHalf = canvasWidth / 2;
 		canvasHeightHalf = canvasHeight / 2;