diff options
| author | Martin Haug <mhaug@live.de> | 2022-03-16 12:36:50 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-03-16 12:36:50 +0100 |
| commit | 4d617bcd67f9e42218da190dc9a0bf2f10d4b78d (patch) | |
| tree | fea275e9321004c15ed7d1def9f3749641f648ed /tests/typ | |
| parent | 288a926feae1e73dff5a6b103aa920d6f7eb0f35 (diff) | |
`LineNode`
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/graphics/line.typ | 47 |
1 files changed, 47 insertions, 0 deletions
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) |
