Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: swapChildren doesn't change rendering order unless the zIndex updated for all children #10606

Closed
bpstudio opened this issue Jun 5, 2024 · 0 comments · Fixed by #10607
Closed
Assignees
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.

Comments

@bpstudio
Copy link

bpstudio commented Jun 5, 2024

Current Behavior

swapChildren doesn't change rendering order unless the zIndex updated for all children

Expected Behavior

The rendering order should change when swapChildren used

Steps to Reproduce

https://www.pixiplayground.com/#/edit/Gwo_yVLnp9LxWZzEQS3Z-

after swapping two children, the rendering order doesn't change

app.stage.swapChildren(app.stage.getChildAt(i), app.stage.getChildAt(i+1))

when add values to zIndex, the order changes properly

for(let c=0; c < app.stage.children.length; c++) {
                    app.stage.getChildAt(c).zIndex = c;
} 

Environment

Possible Solution

Reindexing all children

Additional Information

My example is not perfect, however, it shows the issue.

@Zyie Zyie added the 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. label Jun 6, 2024
@Zyie Zyie self-assigned this Jun 6, 2024
@GoodBoyDigital GoodBoyDigital linked a pull request Jun 14, 2024 that will close this issue
@Zyie Zyie closed this as completed Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants