summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAndrew Voynov <37143421+Andrew15-5@users.noreply.github.com>2023-12-05 21:03:42 +0300
committerGitHub <noreply@github.com>2023-12-05 19:03:42 +0100
commit8a69d3bfb6949c6f8ccae71c05ac1624eacee5a0 (patch)
tree1120b9e1c682758753f6730ab4881df636353b91 /crates
parent295c9267e534f7847a7fb19f13ff2832668bdcf7 (diff)
Rephrased documentation about relativeness for patterns and gradients (#2863)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/visualize/gradient.rs13
-rw-r--r--crates/typst/src/visualize/pattern.rs11
2 files changed, 13 insertions, 11 deletions
diff --git a/crates/typst/src/visualize/gradient.rs b/crates/typst/src/visualize/gradient.rs
index bd08254c..e4878527 100644
--- a/crates/typst/src/visualize/gradient.rs
+++ b/crates/typst/src/visualize/gradient.rs
@@ -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
diff --git a/crates/typst/src/visualize/pattern.rs b/crates/typst/src/visualize/pattern.rs
index d4609fbf..a181ad0d 100644
--- a/crates/typst/src/visualize/pattern.rs
+++ b/crates/typst/src/visualize/pattern.rs
@@ -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