@@ -198,8 +198,7 @@ class DebugPanel extends Renderable {
198198
199199 if ( typeof this . ancestor !== "undefined" ) {
200200 renderer . save ( ) ;
201- // if this object of this renderable parent is not the root container
202- if ( ! this . root && ! this . ancestor . root && this . ancestor . isFloating ) {
201+ if ( ! this . floating ) {
203202 var absolutePosition = this . ancestor . getAbsolutePosition ( ) ;
204203 renderer . translate (
205204 - absolutePosition . x ,
@@ -208,8 +207,10 @@ class DebugPanel extends Renderable {
208207 }
209208 }
210209
210+ var bounds = this . getBounds ( ) ;
211+
211212 renderer . setColor ( "green" ) ;
212- renderer . stroke ( this . getBounds ( ) ) ;
213+ renderer . stroke ( bounds ) ;
213214
214215 // the sprite mask if defined
215216 if ( typeof this . mask !== "undefined" ) {
@@ -218,7 +219,6 @@ class DebugPanel extends Renderable {
218219 }
219220
220221 if ( typeof this . body !== "undefined" ) {
221- var bounds = this . getBounds ( ) ;
222222 renderer . translate ( bounds . x , bounds . y ) ;
223223
224224 renderer . setColor ( "orange" ) ;
@@ -310,7 +310,7 @@ class DebugPanel extends Renderable {
310310
311311 if ( typeof this . ancestor !== "undefined" ) {
312312 // if this object of this renderable parent is not the root container
313- if ( ! this . root && ! this . ancestor . root && this . ancestor . isFloating ) {
313+ if ( ! this . floating ) {
314314 var absolutePosition = this . ancestor . getAbsolutePosition ( ) ;
315315 renderer . translate (
316316 - absolutePosition . x ,
@@ -320,8 +320,14 @@ class DebugPanel extends Renderable {
320320 }
321321
322322 if ( this . renderable instanceof Renderable ) {
323+ var rbounds = this . renderable . getBounds ( ) ;
324+ var rx = - rbounds . x - this . anchorPoint . x * rbounds . width ,
325+ ry = - rbounds . y - this . anchorPoint . y * rbounds . height ;
326+
323327 renderer . setColor ( "green" ) ;
324- renderer . stroke ( this . renderable . getBounds ( ) ) ;
328+ renderer . translate ( rx , ry ) ;
329+ renderer . stroke ( rbounds ) ;
330+ renderer . translate ( - rx , - ry ) ;
325331 }
326332
327333 renderer . translate (
0 commit comments