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. /// 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

View File

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