fix span sizing (still some layout tho)
This commit is contained in:
@@ -34,9 +34,8 @@ impl Widget for Span {
|
||||
}
|
||||
|
||||
fn desired_size(&mut self, ctx: &mut SizeCtx) -> Size {
|
||||
let mut sums = self.len_sum(ctx);
|
||||
let sums = self.len_sum(ctx);
|
||||
let dir_len = if sums.rest == 0.0 && sums.rel == 0.0 {
|
||||
sums.abs += self.gap * self.children.len().saturating_sub(1) as f32;
|
||||
sums
|
||||
} else {
|
||||
Len::default()
|
||||
@@ -71,7 +70,8 @@ impl Span {
|
||||
}
|
||||
|
||||
fn len_sum(&mut self, ctx: &mut SizeCtx) -> Len {
|
||||
self.children.iter_mut().fold(Len::ZERO, |mut s, id| {
|
||||
let gap = self.gap * self.children.len().saturating_sub(1) as f32;
|
||||
self.children.iter_mut().fold(Len::abs(gap), |mut s, id| {
|
||||
s += ctx.size(id).axis(self.dir.axis);
|
||||
s
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user