Skip to content

Commit 0ac5d7b

Browse files
committed
There was some test code left in the DOMElementCSSRenderer file that caused getBoundingClientRect to be called every render. This has been removed, which increases performance significantly for DOM heavy games.
1 parent e23a86d commit 0ac5d7b

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* `Zones` will now use the new `customHitArea` property introduced in 3.17 to avoid their hit areas from being resized if you specified your own custom hit area (thanks @rexrainbow)
88
* The default `BaseShader` vertex shader has a new uniform `uResolution` which is set during the Shader init and load to be the size of the Game Object to which the shader is bound.
99
* The default `BaseShader` vertex shader will now set the `fragCoord` varying to be the Game Object height minus the y inPosition. This will give the correct y axis in the fragment shader, causing 'inverted' shaders to display normally when using the default vertex code.
10+
* There was some test code left in the `DOMElementCSSRenderer` file that caused `getBoundingClientRect` to be called every render. This has been removed, which increases performance significantly for DOM heavy games.
1011

1112
### Bug Fixes
1213

src/gameobjects/domelement/DOMElementCSSRenderer.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, ca
110110
' rotate3d(' + src.rotate3d.x + ',' + src.rotate3d.y + ',' + src.rotate3d.z + ',' + src.rotate3d.w + src.rotate3dAngle + ')';
111111

112112
style.transformOrigin = tx + ' ' + ty;
113-
114-
var nodeBounds = node.getBoundingClientRect();
115-
116-
src.displayWidth = nodeBounds.width;
117-
src.displayHeight = nodeBounds.height;
118113
};
119114

120115
module.exports = DOMElementCSSRenderer;

0 commit comments

Comments
 (0)