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

Sibling SubViewports must be rendered from top to bottom #65579

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

ZuBsPaCe
Copy link
Contributor

@ZuBsPaCe ZuBsPaCe commented Sep 9, 2022

Sibling SubViewports must be rendered in the same order as in the Scene Tree, from top to bottom. _sort_active_viewports() reversed their order.

Fixes #65545

This is not the "Kahn algorithm" anymore, that's why I removed the comment. It resembles an "Iterative Depth First Postorder Tree Traversal" with the added benefit of keeping the Siblings in the correct order.

Sibling SubViewports must be rendered in the same order as in the Scene Tree, from top to bottom. _sort_active_viewports() reversed their order.
Fixes godotengine#65545
@ZuBsPaCe ZuBsPaCe requested a review from a team as a code owner September 9, 2022 16:00
@Calinou Calinou added this to the 4.0 milestone Sep 9, 2022
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, pending passing CI of course

@Rindbee
Copy link
Contributor

Rindbee commented Sep 9, 2022

This still seems to be in activation order (reversed from before), which works fine by default, and may have unexpected results if the order of nodes is moved using move_child. Overall it is better than before.

@akien-mga akien-mga merged commit 22a09fe into godotengine:master Sep 13, 2022
@akien-mga
Copy link
Member

Thanks!

@ZuBsPaCe ZuBsPaCe deleted the fix-viewport-sibling-order branch September 23, 2022 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SubViewports are not rendered in expected order
5 participants