Skip to content

Commit

Permalink
fix example grid (#8940)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
Vrixyz committed Jun 23, 2023
1 parent 75c6641 commit 469a19c
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions examples/ui/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});
});
}

Expand Down

0 comments on commit 469a19c

Please sign in to comment.