summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/layout/stack.rs
diff options
context:
space:
mode:
authorPg Biel <9021226+PgBiel@users.noreply.github.com>2023-07-11 11:11:18 -0300
committerGitHub <noreply@github.com>2023-07-11 16:11:18 +0200
commit9b1a2b41f0bb2d62106e029a5a0174dcf07ae0d2 (patch)
tree6f0ae44b3dfffd1c5b3e44535716d382ffc41c46 /crates/typst-library/src/layout/stack.rs
parent507efc3a1c14e8487705c7424d605a1663d3fe6e (diff)
Add fields and methods to several primitives (#790)
Diffstat (limited to 'crates/typst-library/src/layout/stack.rs')
-rw-r--r--crates/typst-library/src/layout/stack.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/typst-library/src/layout/stack.rs b/crates/typst-library/src/layout/stack.rs
index 97305ddf..8d536638 100644
--- a/crates/typst-library/src/layout/stack.rs
+++ b/crates/typst-library/src/layout/stack.rs
@@ -26,6 +26,15 @@ pub struct StackElem {
/// - `{rtl}`: Right to left.
/// - `{ttb}`: Top to bottom.
/// - `{btt}`: Bottom to top.
+ ///
+ /// You may use the `start` and `end` methods to obtain the initial and
+ /// final points (respectively) of a direction, as `alignment`. You may
+ /// also use the `axis` method to obtain whether a direction is
+ /// `{"horizontal"}` or `{"vertical"}`. Finally, the `inv` method returns
+ /// its inverse direction.
+ ///
+ /// For example, `{ttb.start()}` is `top`, `{ttb.end()}` is `bottom`,
+ /// `{ttb.axis()}` is `{"vertical"}` and `{ttb.inv()}` is equal to `btt`.
#[default(Dir::TTB)]
pub dir: Dir,