Explorar o código

SoftwareRenderer: Workaround for avoiding drawing outside the buffer.

Mr.doob %!s(int64=12) %!d(string=hai) anos
pai
achega
23fa97939b
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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;