Skip to content

Commit 124ecc5

Browse files
committed
Handling baseline with no rows in a grid
1 parent 579086c commit 124ecc5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/widgets/grid.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,11 @@ impl GridLayout {
584584

585585
WidgetLayout {
586586
size: self.orientation.make_size(measured, total_other),
587-
baseline: self.row_baselines[0].baseline,
587+
baseline: self
588+
.row_baselines
589+
.first()
590+
.map(|i| i.baseline)
591+
.unwrap_or_default(),
588592
}
589593
}
590594

0 commit comments

Comments
 (0)