bevy
bevy copied to clipboard
`AlignContent::Center` doesn't seem to work
Bevy version
0.14
What you did
Aligned a node
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
}
fn setup(mut cmds: Commands) {
cmds.spawn(Camera2dBundle::default());
cmds.spawn(NodeBundle {
style: Style {
align_content: AlignContent::Center,
min_width: Val::Percent(100.),
min_height: Val::Percent(100.),
..default()
},
..default()
})
.with_children(|root| {
root.spawn(NodeBundle {
style: Style {
width: Val::Px(50.),
height: Val::Px(50.),
..default()
},
background_color: Color::WHITE.into(),
..default()
});
});
}
What went wrong
In 0.13, the node aligns correctly
but in 0.14, it doesn't
Additional information
I struggle with CSS sometimes, so perhaps I'm missing something. Maybe this was a fix to unexpected behavior? But I can't see why that would be the case.
Repro: https://github.com/Seldom-SE/testetst/blob/aaac435fe295f101a4c879c94edb796fb7c31b6f/src/main.rs