瀏覽代碼

Querying clientHeight forcing synchronous layout (#9760)

Reading clientHeight of canvas during every rAF causes layout thrashing and results in frame drops. Instead re-use the _height local variable available in current scope.
Aswin S 8 年之前
父節點
當前提交
496446f4bf
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/renderers/WebGLRenderer.js

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -2091,7 +2091,7 @@ function WebGLRenderer( parameters ) {
 		uniforms.diffuse.value = material.color;
 		uniforms.opacity.value = material.opacity;
 		uniforms.size.value = material.size * _pixelRatio;
-		uniforms.scale.value = _canvas.clientHeight * 0.5;
+		uniforms.scale.value = _height * 0.5;
 
 		uniforms.map.value = material.map;