summaryrefslogtreecommitdiff
path: root/tests/typ/visualize/pattern-spacing.typ
diff options
context:
space:
mode:
authorSébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com>2023-11-24 15:46:20 +0100
committerGitHub <noreply@github.com>2023-11-24 15:46:20 +0100
commit1756718bab3055597723a9b433419ff07e6b7f02 (patch)
treea06a7a381c994d762c298ec66903db0718877806 /tests/typ/visualize/pattern-spacing.typ
parent3d2f1d2d6cc34fa64c56abd335dd14ea4c932a6c (diff)
Gradient Part 6 - Pattern fills (#2740)
Diffstat (limited to 'tests/typ/visualize/pattern-spacing.typ')
-rw-r--r--tests/typ/visualize/pattern-spacing.typ31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/typ/visualize/pattern-spacing.typ b/tests/typ/visualize/pattern-spacing.typ
new file mode 100644
index 00000000..f8f5f9fd
--- /dev/null
+++ b/tests/typ/visualize/pattern-spacing.typ
@@ -0,0 +1,31 @@
+// Test pattern with different `spacing`.
+
+---
+// Test with spacing set to `(-10pt, -10pt)`
+#let pat(..args) = pattern(size: (30pt, 30pt), ..args)[
+ #square(width: 100%, height: 100%, stroke: 1pt, fill: blue)
+]
+
+#set page(width: 100pt, height: 100pt)
+
+#rect(fill: pat(spacing: (-10pt, -10pt)), width: 100%, height: 100%, stroke: 1pt)
+
+---
+// Test with spacing set to `(0pt, 0pt)`
+#let pat(..args) = pattern(size: (30pt, 30pt), ..args)[
+ #square(width: 100%, height: 100%, stroke: 1pt, fill: blue)
+]
+
+#set page(width: 100pt, height: 100pt)
+
+#rect(fill: pat(spacing: (0pt, 0pt)), width: 100%, height: 100%, stroke: 1pt)
+
+---
+// Test with spacing set to `(10pt, 10pt)`
+#let pat(..args) = pattern(size: (30pt, 30pt), ..args)[
+ #square(width: 100%, height: 100%, stroke: 1pt, fill: blue)
+]
+
+#set page(width: 100pt, height: 100pt)
+
+#rect(fill: pat(spacing: (10pt, 10pt,)), width: 100%, height: 100%, stroke: 1pt)