pixijs / layout

Library for arranging/resizing pixiJS rendered elements basing on css like configs
https://pixijs.io/layout/
MIT License
75 stars 5 forks source link

If calling resize on Layout, property styles is mandatory for anything to be visible #48

Closed ViktorJakobsson closed 1 year ago

ViktorJakobsson commented 1 year ago

Expected Behavior

When initialising Layout the styles property in LayoutOptions should be optional.

Current Behavior

When initialising Layout the styles property in LayoutOptions is set to optional but after calling resize the layout is not visible.

Steps to Reproduce

const graphic = new Graphics()
graphic.beginFill(0xff00ff)
graphic.drawRect(0, 0, 50, 50)
graphic.endFill()

const childLayout = new Layout({
  content: graphic,
  // styles: {} // uncommenting this line makes the graphic visible again
})
childLayout.resize(50, 50) // or removing this line
this.addChild(childLayout)

This happened when upgrading from 0.2.0 to 0.3.1