-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-TextRendering and layout for charactersRendering and layout for charactersC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Milestone
Description
The issue appeared with commit afc721e on the main branch.
Since that commit, the colors of a text block built of TextSpan nodes is messed up. The TextColor of the parent (with Text) is correct. But each TextSpan child uses the previous TextColor component instead of its own, i.e. the first child uses the TextColor of the parent, the second child that of the first and so on.
Here's a minimal example if you want to reproduce the issue.
use bevy::prelude::*;
fn main() {
let mut app = App::new();
app.add_plugins(DefaultPlugins)
.add_systems(Startup, spawn_text)
.run();
}
fn spawn_text(mut commands: Commands) {
commands.spawn(Camera2d);
commands.spawn((
Text::new("B"),
TextColor(Srgba::WHITE.into()),
children![
(TextSpan::new("e"), TextColor(Srgba::RED.into())),
(TextSpan::new("v"), TextColor(Srgba::GREEN.into())),
(TextSpan::new("y"), TextColor(Srgba::BLUE.into()))
],
));
}Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-TextRendering and layout for charactersRendering and layout for charactersC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!