diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-03 11:44:53 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-03 13:35:39 +0100 |
| commit | 37a7afddfaffd44cb9bc013c9506599267e08983 (patch) | |
| tree | 20e7d62d3c5418baff01a21d0406b91bf3096214 /src/library/graphics/hide.rs | |
| parent | 56342bd972a13ffe21beaf2b87ab7eb1597704b4 (diff) | |
Split crates
Diffstat (limited to 'src/library/graphics/hide.rs')
| -rw-r--r-- | src/library/graphics/hide.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/library/graphics/hide.rs b/src/library/graphics/hide.rs deleted file mode 100644 index d320b06c..00000000 --- a/src/library/graphics/hide.rs +++ /dev/null @@ -1,27 +0,0 @@ -use crate::library::prelude::*; - -/// Hide content without affecting layout. -#[derive(Debug, Hash)] -pub struct HideNode(pub Content); - -#[node(LayoutInline)] -impl HideNode { - fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> { - Ok(Self(args.expect("body")?).pack()) - } -} - -impl LayoutInline for HideNode { - fn layout_inline( - &self, - world: Tracked<dyn World>, - regions: &Regions, - styles: StyleChain, - ) -> SourceResult<Vec<Frame>> { - let mut frames = self.0.layout_inline(world, regions, styles)?; - for frame in &mut frames { - frame.clear(); - } - Ok(frames) - } -} |
