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
07d6a12f46
commit
e8ba68d702
@ -344,6 +344,9 @@ impl Default for ButtonBundle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A UI node that is rendered using a [`UiMaterial`]
|
/// 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)]
|
#[derive(Bundle, Clone, Debug)]
|
||||||
pub struct MaterialNodeBundle<M: UiMaterial> {
|
pub struct MaterialNodeBundle<M: UiMaterial> {
|
||||||
/// Describes the logical size of the node
|
/// Describes the logical size of the node
|
||||||
|
@ -354,15 +354,18 @@ pub fn extract_ui_material_nodes<M: UiMaterial>(
|
|||||||
materials: Extract<Res<Assets<M>>>,
|
materials: Extract<Res<Assets<M>>>,
|
||||||
ui_stack: Extract<Res<UiStack>>,
|
ui_stack: Extract<Res<UiStack>>,
|
||||||
uinode_query: Extract<
|
uinode_query: Extract<
|
||||||
Query<(
|
Query<
|
||||||
Entity,
|
(
|
||||||
&Node,
|
Entity,
|
||||||
&Style,
|
&Node,
|
||||||
&GlobalTransform,
|
&Style,
|
||||||
&Handle<M>,
|
&GlobalTransform,
|
||||||
&ViewVisibility,
|
&Handle<M>,
|
||||||
Option<&CalculatedClip>,
|
&ViewVisibility,
|
||||||
)>,
|
Option<&CalculatedClip>,
|
||||||
|
),
|
||||||
|
Without<BackgroundColor>,
|
||||||
|
>,
|
||||||
>,
|
>,
|
||||||
windows: Extract<Query<&Window, With<PrimaryWindow>>>,
|
windows: Extract<Query<&Window, With<PrimaryWindow>>>,
|
||||||
ui_scale: Extract<Res<UiScale>>,
|
ui_scale: Extract<Res<UiScale>>,
|
||||||
|
Loading…
Reference in New Issue
Block a user