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
@ -89,13 +89,11 @@ fn spawn(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
linebreak_behavior,
|
linebreak_behavior,
|
||||||
};
|
};
|
||||||
let text_id = commands
|
let text_id = commands
|
||||||
.spawn((
|
.spawn(TextBundle {
|
||||||
TextBundle {
|
text,
|
||||||
text,
|
background_color: Color::rgb(0.8 - j as f32 * 0.2, 0., 0.).into(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
})
|
||||||
BackgroundColor(Color::rgb(0.8 - j as f32 * 0.2, 0., 0.)),
|
|
||||||
))
|
|
||||||
.id();
|
.id();
|
||||||
commands.entity(column_id).add_child(text_id);
|
commands.entity(column_id).add_child(text_id);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user