diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-09 18:16:59 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-09 18:20:02 +0100 |
| commit | 010cc2effc2fd0e1c4e52d5c914cb4d74506bc0a (patch) | |
| tree | e50060d271f076b00945e5569e7f8ffef2c28e9f /library/src/ext.rs | |
| parent | 12a59963b08b68cc39dcded4d3d3e6a6631c2732 (diff) | |
New block spacing model
Diffstat (limited to 'library/src/ext.rs')
| -rw-r--r-- | library/src/ext.rs | 27 |
1 files changed, 0 insertions, 27 deletions
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<Abs>, below: Option<Abs>) -> Self; - /// Force a size for this content. fn boxed(self, sizing: Axes<Option<Rel<Length>>>) -> Self; @@ -47,30 +44,6 @@ impl ContentExt for Content { text::DecoNode::<{ text::UNDERLINE }>(self).pack() } - fn spaced(self, above: Option<Abs>, below: Option<Abs>) -> 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<Option<Rel<Length>>>) -> Self { layout::BoxNode { sizing, child: self }.pack() } |
