From 670f3f0dce2ced27388b10672d30594d399434e1 Mon Sep 17 00:00:00 2001 From: Ame <104745335+ameknite@users.noreply.github.com> Date: Wed, 26 Apr 2023 16:17:19 -0600 Subject: [PATCH] Fix panic in example: text_wrap_debug.rs (#8497) # Objective - Fix panic caused by incorrectly placed background color ## Solution - Move `BackgroundColor` inside `TextBundle` --- examples/ui/text_wrap_debug.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/ui/text_wrap_debug.rs b/examples/ui/text_wrap_debug.rs index 564fd0160845e..842b677be6108 100644 --- a/examples/ui/text_wrap_debug.rs +++ b/examples/ui/text_wrap_debug.rs @@ -89,13 +89,11 @@ fn spawn(mut commands: Commands, asset_server: Res) { linebreak_behavior, }; let text_id = commands - .spawn(( - TextBundle { - text, - ..Default::default() - }, - BackgroundColor(Color::rgb(0.8 - j as f32 * 0.2, 0., 0.)), - )) + .spawn(TextBundle { + text, + background_color: Color::rgb(0.8 - j as f32 * 0.2, 0., 0.).into(), + ..Default::default() + }) .id(); commands.entity(column_id).add_child(text_id); }