Skip to content

Commit

Permalink
Recalculate MBR on origin change
Browse files Browse the repository at this point in the history
  • Loading branch information
starwed committed Dec 8, 2018
1 parent 9ca2a0f commit bab5a0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/spatial/2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,10 @@ Crafty.c("2D", {
this._origin.x = x;
this._origin.y = y;

if (this._mbr) {
this._calculateMBR();
}

this.trigger("OriginChanged");
return this;
},
Expand Down

0 comments on commit bab5a0c

Please sign in to comment.