We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d972b9 commit 3a68095Copy full SHA for 3a68095
src/layout/linear/spacing.rs
@@ -138,6 +138,11 @@ impl ElementSpacing for DistributeFill {
138
) -> i32 {
139
// bit of a mess, but calculate using i32 in case the views don't fit the space
140
let empty_space = self.0 as i32 - total_size as i32;
141
+
142
+ if objects <= 1 {
143
+ return alignment.align_with_offset(view, reference, empty_space / 2);
144
+ }
145
146
let base = empty_space / (objects - 1) as i32;
147
let remainder = empty_space % (objects - 1) as i32;
148
0 commit comments