File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
newIDE/app/src/ObjectsRendering/Renderers Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,14 @@ export default class RenderedCustomObjectInstance extends RenderedInstance {
458458 this . childrenRenderedInstances . push ( renderer ) ;
459459 this . childrenRenderedInstanceByNames . set ( childObject . getName ( ) , renderer ) ;
460460 } ) ;
461+
462+ if ( this . childrenRenderedInstances . length === 0 ) {
463+ // Show a placeholder.
464+ this . _pixiObject = new PIXI . Sprite (
465+ PixiResourcesLoader . getInvalidPIXITexture ( )
466+ ) ;
467+ this . _pixiContainer . addChild ( this . _pixiObject ) ;
468+ }
461469 }
462470
463471 /**
@@ -609,10 +617,14 @@ export default class RenderedCustomObjectInstance extends RenderedInstance {
609617 }
610618
611619 getDefaultWidth ( ) {
612- return this . childrenRenderedInstances [ 0 ] . getDefaultWidth ( ) ;
620+ return this . childrenRenderedInstances . length > 0
621+ ? this . childrenRenderedInstances [ 0 ] . getDefaultWidth ( )
622+ : 48 ;
613623 }
614624
615625 getDefaultHeight ( ) {
616- return this . childrenRenderedInstances [ 0 ] . getDefaultHeight ( ) ;
626+ return this . childrenRenderedInstances . length > 0
627+ ? this . childrenRenderedInstances [ 0 ] . getDefaultHeight ( )
628+ : 48 ;
617629 }
618630}
You can’t perform that action at this time.
0 commit comments