summaryrefslogtreecommitdiff
path: root/src/library/layout/page.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-05-25 13:50:33 +0200
committerLaurenz <laurmaedje@gmail.com>2022-05-25 13:59:06 +0200
commitc010cbc17dcbb2f0d6005d21530143bf57cb5871 (patch)
tree937fe79f0c121bcc025480181287fd4a3d0c0f4f /src/library/layout/page.rs
parent6935cf8dfefff3d6cf234f077a7d61661fd5ca57 (diff)
Move route from context to VM
Diffstat (limited to 'src/library/layout/page.rs')
-rw-r--r--src/library/layout/page.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/library/layout/page.rs b/src/library/layout/page.rs
index 8db1329f..7d91aa6d 100644
--- a/src/library/layout/page.rs
+++ b/src/library/layout/page.rs
@@ -35,7 +35,7 @@ impl PageNode {
#[property(referenced)]
pub const FOOTER: Marginal = Marginal::None;
- fn construct(_: &mut Context, args: &mut Args) -> TypResult<Content> {
+ fn construct(_: &mut Machine, args: &mut Args) -> TypResult<Content> {
Ok(Content::Page(Self(args.expect("body")?)))
}
@@ -109,7 +109,7 @@ impl PageNode {
let w = size.x - padding.left - padding.right;
let area = Size::new(w, h);
let pod = Regions::one(area, area, area.map(Length::is_finite));
- let sub = Layout::layout(&content, ctx, &pod, styles)?.remove(0);
+ let sub = content.layout(ctx, &pod, styles)?.remove(0);
Arc::make_mut(frame).push_frame(pos, sub);
}
}
@@ -134,7 +134,7 @@ pub struct PagebreakNode;
#[node]
impl PagebreakNode {
- fn construct(_: &mut Context, args: &mut Args) -> TypResult<Content> {
+ fn construct(_: &mut Machine, args: &mut Args) -> TypResult<Content> {
let weak = args.named("weak")?.unwrap_or(false);
Ok(Content::Pagebreak { weak })
}
@@ -158,8 +158,8 @@ impl Marginal {
Self::None => None,
Self::Content(content) => Some(content.clone()),
Self::Func(func, span) => {
- let args = Args::from_values(*span, [Value::Int(page as i64)]);
- Some(func.call(ctx, args)?.display())
+ let args = Args::new(*span, [Value::Int(page as i64)]);
+ Some(func.call_detached(ctx, args)?.display())
}
})
}