Skip to content

Commit f3b8ff6

Browse files
committed
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`.
1 parent 615d3d2 commit f3b8ff6

File tree

1 file changed

+4
-4
lines changed
  • crates/bevy_ui/src/render

1 file changed

+4
-4
lines changed

crates/bevy_ui/src/render/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn get_ui_graph(render_app: &mut App) -> RenderGraph {
169169
pub struct ExtractedUiNode {
170170
pub stack_index: usize,
171171
pub transform: Mat4,
172-
pub background_color: Color,
172+
pub color: Color,
173173
pub rect: Rect,
174174
pub image: Handle<Image>,
175175
pub atlas_size: Option<Vec2>,
@@ -221,7 +221,7 @@ pub fn extract_uinodes(
221221
extracted_uinodes.uinodes.push(ExtractedUiNode {
222222
stack_index,
223223
transform: transform.compute_matrix(),
224-
background_color: color.0,
224+
color: color.0,
225225
rect: Rect {
226226
min: Vec2::ZERO,
227227
max: uinode.calculated_size,
@@ -357,7 +357,7 @@ pub fn extract_text_uinodes(
357357
extracted_uinodes.uinodes.push(ExtractedUiNode {
358358
stack_index,
359359
transform: extracted_transform,
360-
background_color: color,
360+
color,
361361
rect,
362362
image: texture,
363363
atlas_size,
@@ -524,7 +524,7 @@ pub fn prepare_uinodes(
524524
uvs = [uvs[3], uvs[2], uvs[1], uvs[0]];
525525
}
526526

527-
let color = extracted_uinode.background_color.as_linear_rgba_f32();
527+
let color = extracted_uinode.color.as_linear_rgba_f32();
528528
for i in QUAD_INDICES {
529529
ui_meta.vertices.push(UiVertex {
530530
position: positions_clipped[i].into(),

0 commit comments

Comments
 (0)