summaryrefslogtreecommitdiff
path: root/library/src/layout/columns.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-28 12:40:16 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-28 12:40:16 +0100
commit989d170dc7318ca3cbaa5b76760eb14f4e6a8605 (patch)
tree0a486ddb4d339b8a43313f7c6e18b9595b8fd955 /library/src/layout/columns.rs
parent7caf98fe42797eab59a39ef71071030c9790245a (diff)
Fragments
Diffstat (limited to 'library/src/layout/columns.rs')
-rw-r--r--library/src/layout/columns.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/src/layout/columns.rs b/library/src/layout/columns.rs
index b18ba49f..257cc62f 100644
--- a/library/src/layout/columns.rs
+++ b/library/src/layout/columns.rs
@@ -11,7 +11,7 @@ pub struct ColumnsNode {
pub child: Content,
}
-#[node(LayoutBlock)]
+#[node(Layout)]
impl ColumnsNode {
/// The size of the gutter space between each column.
#[property(resolve)]
@@ -26,17 +26,17 @@ impl ColumnsNode {
}
}
-impl LayoutBlock for ColumnsNode {
- fn layout_block(
+impl Layout for ColumnsNode {
+ fn layout(
&self,
world: Tracked<dyn World>,
styles: StyleChain,
regions: &Regions,
- ) -> SourceResult<Vec<Frame>> {
+ ) -> SourceResult<Fragment> {
// Separating the infinite space into infinite columns does not make
// much sense.
if !regions.first.x.is_finite() {
- return self.child.layout_block(world, styles, regions);
+ return self.child.layout(world, styles, regions);
}
// Determine the width of the gutter and each column.
@@ -58,7 +58,7 @@ impl LayoutBlock for ColumnsNode {
};
// Layout the children.
- let mut frames = self.child.layout_block(world, styles, &pod)?.into_iter();
+ let mut frames = self.child.layout(world, styles, &pod)?.into_iter();
let mut finished = vec![];
let dir = styles.get(TextNode::DIR);
@@ -94,7 +94,7 @@ impl LayoutBlock for ColumnsNode {
finished.push(output);
}
- Ok(finished)
+ Ok(Fragment::frames(finished))
}
}