From bab5a0c569a81a5ffb7cfcd94922384f6deafe5c Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Sat, 8 Dec 2018 14:41:55 -0500 Subject: [PATCH] Recalculate MBR on origin change --- src/spatial/2d.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/spatial/2d.js b/src/spatial/2d.js index 7439859a..d2940f84 100644 --- a/src/spatial/2d.js +++ b/src/spatial/2d.js @@ -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; },