diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-10 12:55:21 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-10 12:55:21 +0100 |
| commit | 62f35602a87574dcc607f1637aeae1be574981ff (patch) | |
| tree | 363a1918006e06d7d79dc2ace5f8e59cd3b6bb19 /library/src/visualize | |
| parent | c38d72383d2068361d635d6c1c78ba97aa917801 (diff) | |
New #[func] macro
Diffstat (limited to 'library/src/visualize')
| -rw-r--r-- | library/src/visualize/image.rs | 1 | ||||
| -rw-r--r-- | library/src/visualize/line.rs | 8 | ||||
| -rw-r--r-- | library/src/visualize/shape.rs | 20 |
3 files changed, 14 insertions, 15 deletions
diff --git a/library/src/visualize/image.rs b/library/src/visualize/image.rs index 1fdb418b..78f477f6 100644 --- a/library/src/visualize/image.rs +++ b/library/src/visualize/image.rs @@ -23,7 +23,6 @@ use crate::prelude::*; #[node(Layout)] pub struct ImageNode { /// Path to an image file. - #[positional] #[required] #[parse( let Spanned { v: path, span } = diff --git a/library/src/visualize/line.rs b/library/src/visualize/line.rs index 015abbb0..b39170f0 100644 --- a/library/src/visualize/line.rs +++ b/library/src/visualize/line.rs @@ -21,15 +21,15 @@ pub struct LineNode { /// The offset from `start` where the line ends. #[resolve] - pub end: Smart<Axes<Rel<Length>>>, + pub end: Option<Axes<Rel<Length>>>, - /// The line's length. Mutually exclusive with `end`. + /// The line's length. This is only respected if `end` is `none`. #[resolve] #[default(Abs::pt(30.0).into())] pub length: Rel<Length>, - /// The angle at which the line points away from the origin. Mutually - /// exclusive with `end`. + /// The angle at which the line points away from the origin. This is only + /// respected if `end` is `none`. pub angle: Angle, /// How to stroke the line. This can be: diff --git a/library/src/visualize/shape.rs b/library/src/visualize/shape.rs index ab953846..02b45ed5 100644 --- a/library/src/visualize/shape.rs +++ b/library/src/visualize/shape.rs @@ -176,15 +176,15 @@ impl Layout for RectNode { /// ] /// ``` /// -/// ## Parameters -/// - size: `Smart<Length>` (named, settable) -/// The square's side length. This is mutually exclusive with `width` and -/// `height`. -/// /// Display: Square /// Category: visualize #[node(Layout)] pub struct SquareNode { + /// The square's side length. This is mutually exclusive with `width` and + /// `height`. + #[external] + pub size: Smart<Length>, + /// The square's width. This is mutually exclusive with `size` and `height`. /// /// In contrast to `size`, this can be relative to the parent container's @@ -367,15 +367,15 @@ impl Layout for EllipseNode { /// ] /// ``` /// -/// ## Parameters -/// - radius: `Length` (named, settable) -/// The circle's radius. This is mutually exclusive with `width` and -/// `height`. -/// /// Display: Circle /// Category: visualize #[node(Layout)] pub struct CircleNode { + /// The circle's radius. This is mutually exclusive with `width` and + /// `height`. + #[external] + pub radius: Length, + /// The circle's width. This is mutually exclusive with `radius` and /// `height`. /// |
