From 469a19c290861049ad121aa83d72f830d1ec9b40 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Fri, 23 Jun 2023 23:28:11 +0200 Subject: [PATCH] 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. --- examples/ui/grid.rs | 53 +++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/examples/ui/grid.rs b/examples/ui/grid.rs index 9012e198d8708..0931c0767bd14 100644 --- a/examples/ui/grid.rs +++ b/examples/ui/grid.rs @@ -169,34 +169,31 @@ fn spawn_layout(mut commands: Commands, asset_server: Res) { ..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() + }); }); }