Skip to content

Commit 017eb32

Browse files
committed
GameObject.getBounds now factors in origin.
1 parent f005380 commit 017eb32

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

v3/src/gameobjects/components/GetBounds.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
var Rectangle = require('../../geom/rectangle/Rectangle');
2+
13
var GetBounds = {
24

35
getBounds: function (output)
46
{
5-
if (output === undefined) { output = { x: 0, y: 0, width: 0, height: 0 }; }
7+
if (output === undefined) { output = new Rectangle(); }
68

7-
var x = this.x;
8-
var y = this.y;
9+
var x = this.x - this.displayOriginX;
10+
var y = this.y - this.displayOriginY;
911

1012
var w = this.displayWidth;
1113
var h = this.displayHeight;

0 commit comments

Comments
 (0)