convenience methods for span

This commit is contained in:
2025-12-20 01:38:56 -05:00
parent c00ded78c0
commit 1ccf947220
2 changed files with 11 additions and 3 deletions

View File

@@ -62,6 +62,14 @@ impl Span {
self
}
pub fn push(&mut self, w: WidgetHandle) {
self.children.push(w);
}
pub fn pop(&mut self) -> Option<WidgetHandle> {
self.children.pop()
}
fn len_sum(&mut self, ctx: &mut SizeCtx) -> Len {
let gap = self.gap * self.children.len().saturating_sub(1) as f32;
self.children.iter().fold(Len::abs(gap), |mut s, id| {