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.
|
||||
///
|
||||
/// # Relativeness
|
||||
/// The location of the `{0%}` and `{100%}` stops is dependant on the dimensions
|
||||
/// of a container. This container can either be the shape they are painted on,
|
||||
/// or the closest surrounding container. This is controlled by the `relative`
|
||||
/// argument of a gradient constructor. By default, gradients are relative to
|
||||
/// the shape they are painted on, unless the gradient is applied on text, in
|
||||
/// which case they are relative to the closest ancestor container.
|
||||
/// The location of the `{0%}` and `{100%}` stops depends on the dimensions
|
||||
/// of a container. This container can either be the shape that it is being
|
||||
/// painted on, or the closest surrounding container. This is controlled by the
|
||||
/// `relative` argument of a gradient constructor. By default, gradients are
|
||||
/// relative to the shape they are being painted on, unless the gradient is
|
||||
/// applied on text, in which case they are relative to the closest ancestor
|
||||
/// container.
|
||||
///
|
||||
/// Typst determines the ancestor container as follows:
|
||||
/// - For shapes that are placed at the root/top level of the document, the
|
||||
|
@ -80,11 +80,12 @@ use crate::World;
|
||||
///
|
||||
/// # Relativeness
|
||||
/// 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
|
||||
/// are painted on, or the closest surrounding container. This is controlled by
|
||||
/// the `relative` argument of a pattern constructor. By default, patterns are
|
||||
/// relative to the shape they are painted on, unless the pattern is applied on
|
||||
/// text, in which case they are relative to the closest ancestor container.
|
||||
/// dimensions of a container. This container can either be the shape that it is
|
||||
/// being painted on, or the closest surrounding container. This is controlled
|
||||
/// by the `relative` argument of a pattern constructor. By default, patterns
|
||||
/// are relative to the shape they are being painted on, unless the pattern is
|
||||
/// applied on text, in which case they are relative to the closest ancestor
|
||||
/// container.
|
||||
///
|
||||
/// Typst determines the ancestor container as follows:
|
||||
/// - For shapes that are placed at the root/top level of the document, the
|
||||
|
Loading…
x
Reference in New Issue
Block a user