summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-03-16 12:36:50 +0100
committerMartin Haug <mhaug@live.de>2022-03-16 12:36:50 +0100
commit4d617bcd67f9e42218da190dc9a0bf2f10d4b78d (patch)
treefea275e9321004c15ed7d1def9f3749641f648ed /tests
parent288a926feae1e73dff5a6b103aa920d6f7eb0f35 (diff)
`LineNode`
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/graphics/line.pngbin0 -> 3467 bytes
-rw-r--r--tests/typ/graphics/line.typ47
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/ref/graphics/line.png b/tests/ref/graphics/line.png
new file mode 100644
index 00000000..49f05f0d
--- /dev/null
+++ b/tests/ref/graphics/line.png
Binary files differ
diff --git a/tests/typ/graphics/line.typ b/tests/typ/graphics/line.typ
new file mode 100644
index 00000000..d89c703a
--- /dev/null
+++ b/tests/typ/graphics/line.typ
@@ -0,0 +1,47 @@
+// Test lines
+
+---
+// Default line.
+#line()
+
+---
+// Test the to argument.
+{
+ line(to: (10pt, 0pt))
+ line(origin: (0pt, 10pt), to: (0pt, 0pt))
+ line(to: (15pt, 15pt))
+}
+#v(.5cm)
+
+---
+
+#set page(fill: rgb("0B1026"))
+#set line(stroke: white)
+
+#let star(width, ..args) = box(width: width, height: width)[
+ #set text(spacing: 0%)
+ #set line(..args)
+
+ #line(length: +30%, origin: (09.0%, 02%))
+ #line(length: +30%, origin: (38.7%, 02%), angle: -72deg)
+ #line(length: +30%, origin: (57.5%, 02%), angle: 252deg)
+ #line(length: +30%, origin: (57.3%, 02%))
+ #line(length: -30%, origin: (88.0%, 02%), angle: -36deg)
+ #line(length: +30%, origin: (73.3%, 48%), angle: 252deg)
+ #line(length: -30%, origin: (73.5%, 48%), angle: 36deg)
+ #line(length: +30%, origin: (25.4%, 48%), angle: -36deg)
+ #line(length: +30%, origin: (25.6%, 48%), angle: -72deg)
+ #line(length: +32%, origin: (8.50%, 02%), angle: 34deg)
+]
+
+#grid(columns: (1fr, ) * 3, ..((star(20pt, thickness: .5pt), ) * 9))
+
+---
+// Test errors.
+
+// Error: 11-18 point array must contain exactly two entries
+#line(to: (50pt,))
+
+---
+// Error: 15-27 expected relative length, found angle
+#line(origin: (3deg, 10pt), length: 5cm)