pixijs/layers

Ability to reset parentGroup to null

Closed this issue · 1 comments

motla commented

Hi,

I would like to make a PR that resets ._activeParentLayer to null when the user sets .parentGroup to null.

In fact:

var bunny = new PIXI.Sprite(...);
var my_group = new PIXI.display.Group(...);

console.log(bunny.parentGroup); // null
// bunny displays fine although bunny.parentGroup set to null by default

bunny.parentGroup = my_group;
// bunny displays fine when bunny.parentGroup set to my_group

bunny.parentGroup = null;
// bunny does not display anymore because bunny._activeParentLayer was not reset internally

bunny._activeParentLayer = null;
// bunny displays fine

🚀 I made a playground for you to test.

I looked at the code but how to implement this is not obvious to me.
If you don't have the time to fix it, can you guide me how to implement this without breaking any functionality.

Thanks

fortunately, that bug was fixed in latest version :) i dont know how did i even miss that

try @pixi/layers