fix example grid (#8940)

`Style` flattened `size`, `min_size` and `max_size` to its root struct,
causing compilation errors.

I uncommented the code to avoid further silent error not caught by CI,
but hid the view to keep the same behaviour.
This commit is contained in:
Thierry Berger 2023-06-23 23:28:11 +02:00 committed by GitHub
parent 75c6641b41
commit 469a19c290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,34 +169,31 @@ fn spawn_layout(mut commands: Commands, asset_server: Res<AssetServer>) {
..default()
});
// Modal (absolutely positioned on top of content - uncomment to view)
// builder.spawn(NodeBundle {
// style: Style {
// position_type: PositionType::Absolute,
// margin: UiRect {
// top: Val::Px(100.),
// bottom: Val::Auto,
// left: Val::Auto,
// right: Val::Auto,
// },
// size: Size {
// width: Val::Percent(60.),
// height: Val::Px(300.),
// },
// max_size: Size {
// width: Val::Px(600.),
// height: Val::Auto,
// },
// ..default()
// },
// background_color: BackgroundColor(Color::Rgba {
// red: 255.0,
// green: 255.0,
// blue: 255.0,
// alpha: 0.8,
// }),
// ..default()
// });
// Modal (absolutely positioned on top of content - currently hidden: to view it, change its visibility)
builder.spawn(NodeBundle {
visibility: Visibility::Hidden,
style: Style {
position_type: PositionType::Absolute,
margin: UiRect {
top: Val::Px(100.),
bottom: Val::Auto,
left: Val::Auto,
right: Val::Auto,
},
width: Val::Percent(60.),
height: Val::Px(300.),
max_width: Val::Px(600.),
max_height: Val::Auto,
..default()
},
background_color: BackgroundColor(Color::Rgba {
red: 255.0,
green: 255.0,
blue: 255.0,
alpha: 0.8,
}),
..default()
});
});
}