summaryrefslogtreecommitdiff
path: root/library/src/visualize
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-17 16:24:29 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-17 16:24:29 +0100
commit35b16e545b4fce299edbc00c9a9754179fa51634 (patch)
treeeb1081e55187e59ff6482abc1ac2f1932606ef59 /library/src/visualize
parentb6202b646a0d5ecced301d9bac8bfcaf977d7ee4 (diff)
Document parameters in comment
Diffstat (limited to 'library/src/visualize')
-rw-r--r--library/src/visualize/image.rs9
-rw-r--r--library/src/visualize/line.rs15
-rw-r--r--library/src/visualize/shape.rs21
3 files changed, 40 insertions, 5 deletions
diff --git a/library/src/visualize/image.rs b/library/src/visualize/image.rs
index 936ec3bf..0ce3f20b 100644
--- a/library/src/visualize/image.rs
+++ b/library/src/visualize/image.rs
@@ -6,7 +6,14 @@ use crate::prelude::*;
/// Show a raster or vector graphic.
///
-/// Tags: visualize.
+/// Supported formats are PNG, JPEG, GIF and SVG.
+///
+/// # Parameters
+/// - path: EcoString (positional, required)
+/// Path to an image file.
+///
+/// # Tags
+/// - visualize
#[func]
#[capable(Layout, Inline)]
#[derive(Debug, Hash)]
diff --git a/library/src/visualize/line.rs b/library/src/visualize/line.rs
index 9c9b8b00..5c8c9644 100644
--- a/library/src/visualize/line.rs
+++ b/library/src/visualize/line.rs
@@ -2,7 +2,20 @@ use crate::prelude::*;
/// Display a line without affecting the layout.
///
-/// Tags: visualize.
+/// You should only provide either an endpoint or an angle and a length.
+///
+/// # Parameters
+/// - origin: Axes<Rel<Length>> (named)
+/// The start point of the line.
+/// - to: Axes<Rel<Length>> (named)
+/// The end point of the line.
+/// - length: Rel<Length> (named)
+/// The line's length.
+/// - angle: Angle (named)
+/// The angle at which the line points away from the origin.
+///
+/// # Tags
+/// - visualize
#[func]
#[capable(Layout, Inline)]
#[derive(Debug, Hash)]
diff --git a/library/src/visualize/shape.rs b/library/src/visualize/shape.rs
index a3443189..be80b4fb 100644
--- a/library/src/visualize/shape.rs
+++ b/library/src/visualize/shape.rs
@@ -4,7 +4,22 @@ use crate::prelude::*;
/// A sizable and fillable shape with optional content.
///
-/// Tags: visualize.
+/// # Parameters
+/// - body: Content (positional)
+/// The content to place into the shape.
+/// - width: Rel<Length> (named)
+/// The shape's width.
+/// - height: Rel<Length> (named)
+/// The shape's height.
+/// - size: Length (named)
+/// The square's side length.
+/// - radius: Length (named)
+/// The circle's radius.
+/// - stroke: Smart<Sides<Option<PartialStroke>>> (named)
+/// How to stroke the shape.
+///
+/// # Tags
+/// - visualize
#[func]
#[capable(Layout, Inline)]
#[derive(Debug, Hash)]
@@ -27,7 +42,7 @@ impl<const S: ShapeKind> ShapeNode<S> {
/// How to fill the shape.
pub const FILL: Option<Paint> = None;
/// How to stroke the shape.
- #[property(reflect, skip, resolve, fold)]
+ #[property(skip, resolve, fold)]
pub const STROKE: Smart<Sides<Option<PartialStroke>>> = Smart::Auto;
/// How much to pad the shape's content.
@@ -38,7 +53,7 @@ impl<const S: ShapeKind> ShapeNode<S> {
pub const OUTSET: Sides<Option<Rel<Length>>> = Sides::splat(Rel::zero());
/// How much to round the shape's corners.
- #[property(reflect, skip, resolve, fold)]
+ #[property(skip, resolve, fold)]
pub const RADIUS: Corners<Option<Rel<Length>>> = Corners::splat(Rel::zero());
fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> {