Can't center inside of a grid both vertically and horizontally.
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 67
Description
I'm totally not sure whether that's a bug, or anything, but I've read through the docs couple of times, and for example this code that seems to overdo it but convey what I want:
```
ui.with_layout(Layout::left_to_right(Align::Center).with_main_align(Align::Center).with_cross_align(Align::Center), |ui| {
ui.label(format!("{:?}", v));
});
```
Results in vertical alignment to center, and main alignment to left.
The only code I've found through trial and error that is capable of centering it horizontally is this:
```
ui.with_layout(Layout::top_down(Align::Center).with_cross_align(Align::Center), |ui| {
ui.label(format!("{:?}", v));
});
```
But of course, then it's vertically aligned on the very ceiling of the cell.
The crux of the problem is that this
```
ui.with_layout(Layout::left_to_right(Align::Center).with_main_align(Align::Center), |ui| {
ui.label(format!("{:?}", v));
});
```
centers vertically, not horizontally, inside Grid. (which seems to be default centering inside Grid along vertical axis)
Contributor guide
Assessment
This issue has not been assessed yet.