Skip to content

Commit

Permalink
UI extraction order fix (#9099)
Browse files Browse the repository at this point in the history
# Objective

Fixes #9097

## Solution

Reorder the `ExtractSchedule` so that the `extract_text_uinodes` and
`extract_uinode_borders` systems are run after `extract_atlas_uinodes`.

## Changelog

`bevy_ui::render`:
* Added the `ExtractAtlasNode` variant to `RenderUiSystem`.
* Changed `ExtractSchedule` so that `extract_uinode_borders` and
`extract_text_uinodes` run after `extract_atlas_uinodes`.
  • Loading branch information
ickshonpe authored Jul 23, 2023
1 parent 70a7eb0 commit a879f98
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/bevy_ui/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub const UI_SHADER_HANDLE: HandleUntyped =
#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
pub enum RenderUiSystem {
ExtractNode,
ExtractAtlasNode,
}

pub fn build_ui_render(app: &mut App) {
Expand All @@ -82,10 +83,12 @@ pub fn build_ui_render(app: &mut App) {
extract_default_ui_camera_view::<Camera2d>,
extract_default_ui_camera_view::<Camera3d>,
extract_uinodes.in_set(RenderUiSystem::ExtractNode),
extract_atlas_uinodes.after(RenderUiSystem::ExtractNode),
extract_uinode_borders.after(RenderUiSystem::ExtractNode),
extract_atlas_uinodes
.in_set(RenderUiSystem::ExtractAtlasNode)
.after(RenderUiSystem::ExtractNode),
extract_uinode_borders.after(RenderUiSystem::ExtractAtlasNode),
#[cfg(feature = "bevy_text")]
extract_text_uinodes.after(RenderUiSystem::ExtractNode),
extract_text_uinodes.after(RenderUiSystem::ExtractAtlasNode),
),
)
.add_systems(
Expand Down

0 comments on commit a879f98

Please sign in to comment.