Browse Source

fix warn getSize

sunag 6 years ago
parent
commit
52318310d2
1 changed files with 5 additions and 2 deletions
  1. 5 2
      examples/js/nodes/accessors/ResolutionNode.js

+ 5 - 2
examples/js/nodes/accessors/ResolutionNode.js

@@ -8,6 +8,8 @@ function ResolutionNode() {
 
 
 	Vector2Node.call( this );
 	Vector2Node.call( this );
 
 
+	this.size = new THREE.Vector2();
+
 }
 }
 
 
 ResolutionNode.prototype = Object.create( Vector2Node.prototype );
 ResolutionNode.prototype = Object.create( Vector2Node.prototype );
@@ -18,8 +20,9 @@ ResolutionNode.prototype.updateFrame = function ( frame ) {
 
 
 	if ( frame.renderer ) {
 	if ( frame.renderer ) {
 
 
-		var size = frame.renderer.getSize(),
-			pixelRatio = frame.renderer.getPixelRatio();
+		frame.renderer.getSize( this.size );
+
+		var pixelRatio = frame.renderer.getPixelRatio();
 
 
 		this.x = size.width * pixelRatio;
 		this.x = size.width * pixelRatio;
 		this.y = size.height * pixelRatio;
 		this.y = size.height * pixelRatio;