浏览代码

Merge pull request #11535 from sunag/86dev

ResolutionNode fix pixel ratio
Mr.doob 8 年之前
父节点
当前提交
b550539a28
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      examples/js/nodes/utils/ResolutionNode.js

+ 4 - 3
examples/js/nodes/utils/ResolutionNode.js

@@ -17,9 +17,10 @@ THREE.ResolutionNode.prototype.constructor = THREE.ResolutionNode;
 
 
 THREE.ResolutionNode.prototype.updateFrame = function( delta ) {
 THREE.ResolutionNode.prototype.updateFrame = function( delta ) {
 
 
-	var size = this.renderer.getSize();
+	var size = this.renderer.getSize(),
+		pixelRatio = this.renderer.getPixelRatio();
 
 
-	this.x = size.width;
-	this.y = size.height;
+	this.x = size.width * pixelRatio;
+	this.y = size.height * pixelRatio;
 
 
 };
 };