Rephrased documentation about relativeness for patterns and gradients (#2863)

This commit is contained in:
Andrew Voynov 2023-12-05 21:03:42 +03:00 committed by GitHub
parent 295c9267e5
commit 8a69d3bfb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View File

@ -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

View File

@ -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