From 010cc2effc2fd0e1c4e52d5c914cb4d74506bc0a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 9 Nov 2022 18:16:59 +0100 Subject: New block spacing model --- library/src/ext.rs | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'library/src/ext.rs') diff --git a/library/src/ext.rs b/library/src/ext.rs index 70b69dce..0735dc18 100644 --- a/library/src/ext.rs +++ b/library/src/ext.rs @@ -12,9 +12,6 @@ pub trait ContentExt { /// Underline this content. fn underlined(self) -> Self; - /// Add weak vertical spacing above and below the content. - fn spaced(self, above: Option, below: Option) -> Self; - /// Force a size for this content. fn boxed(self, sizing: Axes>>) -> Self; @@ -47,30 +44,6 @@ impl ContentExt for Content { text::DecoNode::<{ text::UNDERLINE }>(self).pack() } - fn spaced(self, above: Option, below: Option) -> Self { - if above.is_none() && below.is_none() { - return self; - } - - let mut seq = vec![]; - if let Some(above) = above { - seq.push( - layout::VNode { amount: above.into(), weak: true, generated: true } - .pack(), - ); - } - - seq.push(self); - if let Some(below) = below { - seq.push( - layout::VNode { amount: below.into(), weak: true, generated: true } - .pack(), - ); - } - - Content::sequence(seq) - } - fn boxed(self, sizing: Axes>>) -> Self { layout::BoxNode { sizing, child: self }.pack() } -- cgit v1.2.3