11/*!
2- * melonJS debug plugin - v14.5.1
2+ * melonJS debug plugin - v14.5.2
33 * http://www.melonjs.org
44 * @melonjs /debug-plugin is licensed under the MIT License.
55 * http://www.opensource.org/licenses/mit-license
@@ -71,7 +71,7 @@ class DebugPanel extends Renderable {
7171 this . name = "debugPanel" ;
7272
7373 // the debug panel version
74- this . version = "14.5.1 " ;
74+ this . version = "14.5.2 " ;
7575
7676 // persistent
7777 this . isPersistent = true ;
@@ -202,8 +202,7 @@ class DebugPanel extends Renderable {
202202
203203 if ( typeof this . ancestor !== "undefined" ) {
204204 renderer . save ( ) ;
205- // if this object of this renderable parent is not the root container
206- if ( ! this . root && ! this . ancestor . root && this . ancestor . isFloating ) {
205+ if ( ! this . floating ) {
207206 var absolutePosition = this . ancestor . getAbsolutePosition ( ) ;
208207 renderer . translate (
209208 - absolutePosition . x ,
@@ -212,8 +211,10 @@ class DebugPanel extends Renderable {
212211 }
213212 }
214213
214+ var bounds = this . getBounds ( ) ;
215+
215216 renderer . setColor ( "green" ) ;
216- renderer . stroke ( this . getBounds ( ) ) ;
217+ renderer . stroke ( bounds ) ;
217218
218219 // the sprite mask if defined
219220 if ( typeof this . mask !== "undefined" ) {
@@ -222,7 +223,6 @@ class DebugPanel extends Renderable {
222223 }
223224
224225 if ( typeof this . body !== "undefined" ) {
225- var bounds = this . getBounds ( ) ;
226226 renderer . translate ( bounds . x , bounds . y ) ;
227227
228228 renderer . setColor ( "orange" ) ;
@@ -314,7 +314,7 @@ class DebugPanel extends Renderable {
314314
315315 if ( typeof this . ancestor !== "undefined" ) {
316316 // if this object of this renderable parent is not the root container
317- if ( ! this . root && ! this . ancestor . root && this . ancestor . isFloating ) {
317+ if ( ! this . floating ) {
318318 var absolutePosition = this . ancestor . getAbsolutePosition ( ) ;
319319 renderer . translate (
320320 - absolutePosition . x ,
@@ -324,8 +324,14 @@ class DebugPanel extends Renderable {
324324 }
325325
326326 if ( this . renderable instanceof Renderable ) {
327+ var rbounds = this . renderable . getBounds ( ) ;
328+ var rx = - rbounds . x - this . anchorPoint . x * rbounds . width ,
329+ ry = - rbounds . y - this . anchorPoint . y * rbounds . height ;
330+
327331 renderer . setColor ( "green" ) ;
328- renderer . stroke ( this . renderable . getBounds ( ) ) ;
332+ renderer . translate ( rx , ry ) ;
333+ renderer . stroke ( rbounds ) ;
334+ renderer . translate ( - rx , - ry ) ;
329335 }
330336
331337 renderer . translate (
@@ -591,7 +597,7 @@ class DebugPanelPlugin extends plugin.Base {
591597 super ( ) ;
592598
593599 // minimum melonJS version expected
594- this . version = "14.5.0 " ;
600+ this . version = "15.1.5 " ;
595601
596602 this . panel = new DebugPanel ( debugToggle ) ;
597603
0 commit comments