Skip to content

Commit

Permalink
Fix #6871. DOM element displayWidth, displayHeight set to scaleX and …
Browse files Browse the repository at this point in the history
…scaleY
  • Loading branch information
zekeatchan committed Jan 23, 2025
1 parent 63388cd commit fbd0b51
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/gameobjects/domelement/DOMElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,8 @@ var DOMElement = new Class({
},

/**
* Internal method that calls `getBoundingClientRect` on the `node` and then sets the bounds width
* and height into the `displayWidth` and `displayHeight` properties, and the `clientWidth` and `clientHeight`
* values into the `width` and `height` properties respectively.
* Internal method that sets the `displayWidth` and `displayHeight` properties, and the `clientWidth`
* and `clientHeight` values into the `width` and `height` properties respectively.
*
* This is called automatically whenever a new element is created or set.
*
Expand All @@ -795,13 +794,11 @@ var DOMElement = new Class({
{
var node = this.node;

var nodeBounds = node.getBoundingClientRect();

this.width = node.clientWidth;
this.height = node.clientHeight;

this.displayWidth = nodeBounds.width || 0;
this.displayHeight = nodeBounds.height || 0;
this.displayWidth = this.width * this.scaleX;
this.displayHeight = this.height * this.scaleY;

return this;
},
Expand Down

0 comments on commit fbd0b51

Please sign in to comment.