Skip to content

Commit

Permalink
Revise docs for place element (#4105)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebear94 committed May 13, 2024
1 parent e8ee152 commit 7b656b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/typst/src/layout/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ use crate::realize::{Behave, Behaviour};
pub struct PlaceElem {
/// Relative to which position in the parent container to place the content.
///
/// Cannot be `{auto}` if `float` is `{false}` and must be either
/// `{auto}`, `{top}`, or `{bottom}` if `float` is `{true}`.
/// - If `float` is `{false}`, then this can be any alignment other than `{auto}`.
/// - If `float` is `{true}`, then this must be `{auto}`, `{top}`, or `{bottom}`.
///
/// When an axis of the page is `{auto}` sized, all alignments relative to
/// that axis will be ignored, instead, the item will be placed in the
Expand Down Expand Up @@ -77,9 +77,17 @@ pub struct PlaceElem {
/// place(center, dx: amount - 32pt, dy: amount)[A]
/// }
/// ```
///
/// This does not affect the layout of in-flow content.
/// In other words, the placed content is treated as if it
/// were wrapped in a [`move`] element.
pub dx: Rel<Length>,

/// The vertical displacement of the placed content.
///
/// This does not affect the layout of in-flow content.
/// In other words, the placed content is treated as if it
/// were wrapped in a [`move`] element.
pub dy: Rel<Length>,

/// The content to place.
Expand Down

0 comments on commit 7b656b3

Please sign in to comment.