-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-TextRendering and layout for charactersRendering and layout for charactersA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-BlockedThis cannot move forward until something else changesThis cannot move forward until something else changes
Description
Bevy version
0.15.0-rc.3
What you did
render a bit of text with the following code.
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera3d::default());
commands.spawn(Node::default()).with_children(|c| {
c.spawn((Node {
flex_direction: FlexDirection::Column,
width: Val::Px(500.0),
..Default::default()
},))
.with_children(|c| {
c.spawn((
Node {
min_width: Val::Px(500.0), // changing this to 499.999 works as expected
..Default::default()
},
BackgroundColor::from(Color::srgba(0.0, 0.0, 1.0, 1.0)),
))
.with_children(|c| {
c.spawn((Text::new("Some text and some more text"), ZIndex(1)));
});
});
});
}
What went wrong
the text container is much too large vertically.
Additional info
- changing the min_width of the 3rd node to 499.999 or smaller sizes the text correctly (so maybe a propagation problem in taffy)
- making the text shorter makes the oversize decrease, making it longer makes it increase
(so maybe a text measure problem) - this was also an issue in 0.14.x
Metadata
Metadata
Assignees
Labels
A-TextRendering and layout for charactersRendering and layout for charactersA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-BlockedThis cannot move forward until something else changesThis cannot move forward until something else changes