-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing the color of a TextSection triggers a redraw of the full Text #6967
Comments
That is true. Text {
sections: vec![
TextSection {
style: TextStyle {
color: // ...
// ...
}
// ...
}
],
// ...
} ...pub struct Text {
pub sections: Vec<TextSection>,
pub alignment: TextAlignment,
}
pub struct TextSection {
pub value: String,
pub style: TextStyle,
}
pub struct TextAlignment {
pub vertical: VerticalAlign,
pub horizontal: HorizontalAlign,
}
pub enum VerticalAlign {
Top,
Center,
Bottom,
}
pub enum HorizontalAlign {
Left,
Center,
Right,
}
pub struct TextStyle {
pub font: Handle<Font>,
pub font_size: f32,
pub color: Color,
} Just exploring the many possible solutions: Detect changes to
|
Bevy version
0.9.1
What went wrong
Changing the
Color
of aTextSection
trips change detection causing the entireText
to be needlessly recomputed.Additional information
Workaround:
related: #6956, #5935
The text was updated successfully, but these errors were encountered: