mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 14:10:19 +00:00
UI Materials: ignore entities with a BackgroundColor
component (#10434)
# Objective - Entities with both a `BackgroundColor` and a `Handle<CustomUiMaterial>` are extracted by both pipelines and results in entities being overwritten in the render world - Fixes #10431 ## Solution - Ignore entities with `BackgroundColor` when extracting ui material entities, and document that limit
This commit is contained in:
parent
aaef5577cd
commit
72a6106f2e
2 changed files with 15 additions and 9 deletions
|
@ -344,6 +344,9 @@ impl Default for ButtonBundle {
|
|||
}
|
||||
|
||||
/// A UI node that is rendered using a [`UiMaterial`]
|
||||
///
|
||||
/// Adding a `BackgroundColor` component to an entity with this bundle will ignore the custom
|
||||
/// material and use the background color instead.
|
||||
#[derive(Bundle, Clone, Debug)]
|
||||
pub struct MaterialNodeBundle<M: UiMaterial> {
|
||||
/// Describes the logical size of the node
|
||||
|
|
|
@ -354,15 +354,18 @@ pub fn extract_ui_material_nodes<M: UiMaterial>(
|
|||
materials: Extract<Res<Assets<M>>>,
|
||||
ui_stack: Extract<Res<UiStack>>,
|
||||
uinode_query: Extract<
|
||||
Query<(
|
||||
Entity,
|
||||
&Node,
|
||||
&Style,
|
||||
&GlobalTransform,
|
||||
&Handle<M>,
|
||||
&ViewVisibility,
|
||||
Option<&CalculatedClip>,
|
||||
)>,
|
||||
Query<
|
||||
(
|
||||
Entity,
|
||||
&Node,
|
||||
&Style,
|
||||
&GlobalTransform,
|
||||
&Handle<M>,
|
||||
&ViewVisibility,
|
||||
Option<&CalculatedClip>,
|
||||
),
|
||||
Without<BackgroundColor>,
|
||||
>,
|
||||
>,
|
||||
windows: Extract<Query<&Window, With<PrimaryWindow>>>,
|
||||
ui_scale: Extract<Res<UiScale>>,
|
||||
|
|
Loading…
Reference in a new issue