summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHydroH <ixlesis@gmail.com>2024-07-22 22:24:29 +0800
committerGitHub <noreply@github.com>2024-07-22 14:24:29 +0000
commit1d74c8e8bfe47723f62eb0dbb3852c07a43be5fd (patch)
tree8db52750dd488ed3611a5328cd1407f302897c76 /tests
parent684efa2e0eadcf5b5d7d216ab8f5f5b1c68a35a6 (diff)
Add `non-zero` and `even-odd` fill rules to `path` and `polygon` (#4580)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/path.pngbin3150 -> 4364 bytes
-rw-r--r--tests/ref/polygon.pngbin3375 -> 3642 bytes
-rw-r--r--tests/suite/visualize/path.typ24
-rw-r--r--tests/suite/visualize/polygon.typ2
4 files changed, 24 insertions, 2 deletions
diff --git a/tests/ref/path.png b/tests/ref/path.png
index 9643a476..5aa3b882 100644
--- a/tests/ref/path.png
+++ b/tests/ref/path.png
Binary files differ
diff --git a/tests/ref/polygon.png b/tests/ref/polygon.png
index 1dc11083..05090e1e 100644
--- a/tests/ref/polygon.png
+++ b/tests/ref/polygon.png
Binary files differ
diff --git a/tests/suite/visualize/path.typ b/tests/suite/visualize/path.typ
index bdd3dc72..95f7a803 100644
--- a/tests/suite/visualize/path.typ
+++ b/tests/suite/visualize/path.typ
@@ -1,10 +1,10 @@
// Test paths.
--- path ---
-#set page(height: 200pt, width: 200pt)
+#set page(height: 300pt, width: 200pt)
#table(
columns: (1fr, 1fr),
- rows: (1fr, 1fr),
+ rows: (1fr, 1fr, 1fr),
align: center + horizon,
path(
fill: red,
@@ -37,6 +37,26 @@
(30pt, 30pt),
(15pt, 0pt),
),
+ path(
+ fill: red,
+ fill-rule: "non-zero",
+ closed: true,
+ (25pt, 0pt),
+ (10pt, 50pt),
+ (50pt, 20pt),
+ (0pt, 20pt),
+ (40pt, 50pt),
+ ),
+ path(
+ fill: red,
+ fill-rule: "even-odd",
+ closed: true,
+ (25pt, 0pt),
+ (10pt, 50pt),
+ (50pt, 20pt),
+ (0pt, 20pt),
+ (40pt, 50pt),
+ ),
)
--- path-bad-vertex ---
diff --git a/tests/suite/visualize/polygon.typ b/tests/suite/visualize/polygon.typ
index a3f4c8ef..7d8342c8 100644
--- a/tests/suite/visualize/polygon.typ
+++ b/tests/suite/visualize/polygon.typ
@@ -27,6 +27,8 @@
// Self-intersections
#polygon((0pt, 10pt), (30pt, 20pt), (0pt, 30pt), (20pt, 0pt), (20pt, 35pt))
+#polygon(fill-rule: "non-zero", (0pt, 10pt), (30pt, 20pt), (0pt, 30pt), (20pt, 0pt), (20pt, 35pt))
+#polygon(fill-rule: "even-odd", (0pt, 10pt), (30pt, 20pt), (0pt, 30pt), (20pt, 0pt), (20pt, 35pt))
// Regular polygon; should have equal side lengths
#for k in range(3, 9) {polygon.regular(size: 30pt, vertices: k,)}