summaryrefslogtreecommitdiff
path: root/library/src/layout/transform.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-14 10:09:44 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-14 10:09:44 +0100
commit9ba4d2c134479aad876a0e2ac4cd1622a353109e (patch)
treea94e0e6ae53a1ba440e869fca26cc2ea0b179057 /library/src/layout/transform.rs
parent4c73456fc1f5df8ebb3a89d9db657c3c54624d66 (diff)
New macro setup
Diffstat (limited to 'library/src/layout/transform.rs')
-rw-r--r--library/src/layout/transform.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/src/layout/transform.rs b/library/src/layout/transform.rs
index 8bf465a9..35b6709a 100644
--- a/library/src/layout/transform.rs
+++ b/library/src/layout/transform.rs
@@ -3,6 +3,8 @@ use typst::geom::Transform;
use crate::prelude::*;
/// Move content without affecting layout.
+#[func]
+#[capable(Layout, Inline)]
#[derive(Debug, Hash)]
pub struct MoveNode {
/// The offset by which to move the content.
@@ -11,7 +13,7 @@ pub struct MoveNode {
pub body: Content,
}
-#[node(Layout, Inline)]
+#[node]
impl MoveNode {
fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> {
let dx = args.named("dx")?.unwrap_or_default();
@@ -44,6 +46,8 @@ impl Layout for MoveNode {
impl Inline for MoveNode {}
/// Transform content without affecting layout.
+#[func]
+#[capable(Layout, Inline)]
#[derive(Debug, Hash)]
pub struct TransformNode<const T: TransformKind> {
/// Transformation to apply to the content.
@@ -58,7 +62,7 @@ pub type RotateNode = TransformNode<ROTATE>;
/// Scale content without affecting layout.
pub type ScaleNode = TransformNode<SCALE>;
-#[node(Layout, Inline)]
+#[node]
impl<const T: TransformKind> TransformNode<T> {
/// The origin of the transformation.
#[property(resolve)]