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

Drain ExtractedUiNodes in prepare_uinodes #9142

Merged
merged 1 commit into from Jul 13, 2023

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Jul 13, 2023

Objective

ExtractedUiNodes is cleared by the extract_uinodes function during the extraction schedule. Because the Bevy UI renderer uses a painters algorithm, this makes it impossible for users to create a custom extraction function that adds items for a node to be drawn behind the rectangle added by extract_uniodes.

Solution

Drain ExtractedUiNodes in prepare_ui_nodes instead, after the extraction schedule has finished.

`ExtractedUiNodes` is cleared by the `extract_uinodes` function during the extraction phase. Because the Bevy UI renderer uses the painters algorithm, this makes it impossible for users to create a custom extraction function that adds items for a node to be drawn behind the rectangle added by `extract_uniodes`.

With this commit, `ExtractUiNodes` is drained in `prepare_ui_nodes` instead, after the extraction schedule has finished.
@ickshonpe ickshonpe changed the title bevy_ui::render Drain ExtractedUiNodes in prepare_uinodes Jul 13, 2023
Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

@cart cart added this pull request to the merge queue Jul 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 13, 2023
@cart cart added this pull request to the merge queue Jul 13, 2023
Merged via the queue into bevyengine:main with commit 0df3d7f Jul 13, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants