summaryrefslogtreecommitdiff
path: root/src/library/layout/pad.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-02 14:48:51 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-02 14:48:51 +0100
commit56342bd972a13ffe21beaf2b87ab7eb1597704b4 (patch)
tree78f9549141e753dde4a938670c54f3fe8695a058 /src/library/layout/pad.rs
parent37ac5d966ebaf97ac79c507028cd5b742b510b89 (diff)
Move layout traits into library
Diffstat (limited to 'src/library/layout/pad.rs')
-rw-r--r--src/library/layout/pad.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/library/layout/pad.rs b/src/library/layout/pad.rs
index effdd5f8..920660d6 100644
--- a/src/library/layout/pad.rs
+++ b/src/library/layout/pad.rs
@@ -1,15 +1,15 @@
use crate::library::prelude::*;
-/// Pad a node at the sides.
+/// Pad content at the sides.
#[derive(Debug, Hash)]
pub struct PadNode {
/// The amount of padding.
pub padding: Sides<Rel<Length>>,
- /// The child node whose sides to pad.
+ /// The content whose sides to pad.
pub child: Content,
}
-#[node(Layout)]
+#[node(LayoutBlock)]
impl PadNode {
fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> {
let all = args.named("rest")?.or(args.find()?);
@@ -25,8 +25,8 @@ impl PadNode {
}
}
-impl Layout for PadNode {
- fn layout(
+impl LayoutBlock for PadNode {
+ fn layout_block(
&self,
world: Tracked<dyn World>,
regions: &Regions,
@@ -51,10 +51,6 @@ impl Layout for PadNode {
Ok(frames)
}
-
- fn level(&self) -> Level {
- Level::Block
- }
}
/// Shrink a size by padding relative to the size itself.