From f3b8ff65497239a0bf8f208b9c0e089a534d2d3c Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Wed, 1 Feb 2023 00:24:25 +0000 Subject: [PATCH] Rename the `background_color` of 'ExtractedUiNode` to `color` (#7452) # Problem The field is called `background_color` but it is also used to hold the colors of text glyphs and images. It's mildly confusing and longer to type than just `color`. ## Solution Rename `background_color` to `color`. ## Changelog * Renamed the `background_color` field of `ExtractedUiNode` to `color`. ## Migration Guide * The `background_color` field of `ExtractedUiNode` is now named `color`. --- crates/bevy_ui/src/render/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index d3d6feec91..900dadcc21 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -169,7 +169,7 @@ fn get_ui_graph(render_app: &mut App) -> RenderGraph { pub struct ExtractedUiNode { pub stack_index: usize, pub transform: Mat4, - pub background_color: Color, + pub color: Color, pub rect: Rect, pub image: Handle, pub atlas_size: Option, @@ -221,7 +221,7 @@ pub fn extract_uinodes( extracted_uinodes.uinodes.push(ExtractedUiNode { stack_index, transform: transform.compute_matrix(), - background_color: color.0, + color: color.0, rect: Rect { min: Vec2::ZERO, max: uinode.calculated_size, @@ -357,7 +357,7 @@ pub fn extract_text_uinodes( extracted_uinodes.uinodes.push(ExtractedUiNode { stack_index, transform: extracted_transform, - background_color: color, + color, rect, image: texture, atlas_size, @@ -524,7 +524,7 @@ pub fn prepare_uinodes( uvs = [uvs[3], uvs[2], uvs[1], uvs[0]]; } - let color = extracted_uinode.background_color.as_linear_rgba_f32(); + let color = extracted_uinode.color.as_linear_rgba_f32(); for i in QUAD_INDICES { ui_meta.vertices.push(UiVertex { position: positions_clipped[i].into(),