summaryrefslogtreecommitdiff
path: root/src/library/transform.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-23 12:45:20 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-23 12:45:20 +0100
commit4f9e5819bbab1f93ad4f4b789038c60487a76368 (patch)
tree488a4e0422db4531d9882cf08f0b5cc21ae55a23 /src/library/transform.rs
parentd3f6040cedacad1b6c323be721c9086f6c5d9a44 (diff)
2d alignments with plus operator
Diffstat (limited to 'src/library/transform.rs')
-rw-r--r--src/library/transform.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/library/transform.rs b/src/library/transform.rs
index 10752358..7553bef2 100644
--- a/src/library/transform.rs
+++ b/src/library/transform.rs
@@ -2,11 +2,10 @@ use super::prelude::*;
/// `move`: Move content without affecting layout.
pub fn move_(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
- let dx = args.named("dx")?;
- let dy = args.named("dy")?;
+ let offset = Spec::new(args.named("x")?, args.named("y")?);
let body: Template = args.expect("body")?;
Ok(Value::Template(Template::from_inline(move |style| {
- body.pack(style).moved(dx, dy)
+ body.pack(style).moved(offset)
})))
}