mirror of
https://github.com/typst/typst
synced 2025-05-17 02:25:27 +08:00
Rephrased documentation about relativeness for patterns and gradients (#2863)
This commit is contained in:
parent
295c9267e5
commit
8a69d3bfb6
@ -72,12 +72,13 @@ use crate::visualize::{Color, ColorSpace, WeightedColor};
|
|||||||
/// stops evenly.
|
/// stops evenly.
|
||||||
///
|
///
|
||||||
/// # Relativeness
|
/// # Relativeness
|
||||||
/// The location of the `{0%}` and `{100%}` stops is dependant on the dimensions
|
/// The location of the `{0%}` and `{100%}` stops depends on the dimensions
|
||||||
/// of a container. This container can either be the shape they are painted on,
|
/// of a container. This container can either be the shape that it is being
|
||||||
/// or the closest surrounding container. This is controlled by the `relative`
|
/// painted on, or the closest surrounding container. This is controlled by the
|
||||||
/// argument of a gradient constructor. By default, gradients are relative to
|
/// `relative` argument of a gradient constructor. By default, gradients are
|
||||||
/// the shape they are painted on, unless the gradient is applied on text, in
|
/// relative to the shape they are being painted on, unless the gradient is
|
||||||
/// which case they are relative to the closest ancestor container.
|
/// applied on text, in which case they are relative to the closest ancestor
|
||||||
|
/// container.
|
||||||
///
|
///
|
||||||
/// Typst determines the ancestor container as follows:
|
/// Typst determines the ancestor container as follows:
|
||||||
/// - For shapes that are placed at the root/top level of the document, the
|
/// - For shapes that are placed at the root/top level of the document, the
|
||||||
|
@ -80,11 +80,12 @@ use crate::World;
|
|||||||
///
|
///
|
||||||
/// # Relativeness
|
/// # Relativeness
|
||||||
/// The location of the starting point of the pattern is dependent on the
|
/// The location of the starting point of the pattern is dependent on the
|
||||||
/// dimensions of a container. This container can either be the shape they
|
/// dimensions of a container. This container can either be the shape that it is
|
||||||
/// are painted on, or the closest surrounding container. This is controlled by
|
/// being painted on, or the closest surrounding container. This is controlled
|
||||||
/// the `relative` argument of a pattern constructor. By default, patterns are
|
/// by the `relative` argument of a pattern constructor. By default, patterns
|
||||||
/// relative to the shape they are painted on, unless the pattern is applied on
|
/// are relative to the shape they are being painted on, unless the pattern is
|
||||||
/// text, in which case they are relative to the closest ancestor container.
|
/// applied on text, in which case they are relative to the closest ancestor
|
||||||
|
/// container.
|
||||||
///
|
///
|
||||||
/// Typst determines the ancestor container as follows:
|
/// Typst determines the ancestor container as follows:
|
||||||
/// - For shapes that are placed at the root/top level of the document, the
|
/// - For shapes that are placed at the root/top level of the document, the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user