mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
Fix panic in example: text_wrap_debug.rs (#8497)
# Objective - Fix panic caused by incorrectly placed background color ## Solution - Move `BackgroundColor` inside `TextBundle`
This commit is contained in:
parent
323705e0ca
commit
670f3f0dce
1 changed files with 5 additions and 7 deletions
|
@ -89,13 +89,11 @@ fn spawn(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue