Skip to content

Commit 8ce70cb

Browse files
committed
Takes any transforms into account to get the correct parent bounds
1 parent db641ca commit 8ce70cb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/core/ScaleManager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,8 +1415,9 @@ Phaser.ScaleManager.prototype = {
14151415
{
14161416
// Ref. http://msdn.microsoft.com/en-us/library/hh781509(v=vs.85).aspx for getBoundingClientRect
14171417
var clientRect = parentNode.getBoundingClientRect();
1418+
var parentRect = parentNode.offsetParent.getBoundingClientRect();
14181419

1419-
bounds.setTo(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
1420+
bounds.setTo(clientRect.left - parentRect.left, clientRect.top - parentRect.top, clientRect.width, clientRect.height);
14201421

14211422
var wc = this.windowConstraints;
14221423

0 commit comments

Comments
 (0)