summaryrefslogtreecommitdiff
path: root/tests/typ/visualize/pattern-relative.typ
blob: 78517e1e111b4a545d0111da988f3659129fd14b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Test pattern with different `relative`.

---
// Test with relative set to `"self"`
#let pat(..args) = pattern(size: (30pt, 30pt), ..args)[
  #place(top + left, line(start: (0%, 0%), end: (100%, 100%), stroke: 1pt))
  #place(top + left, line(start: (0%, 100%), end: (100%, 0%), stroke: 1pt))
]

#set page(fill: pat(), width: 100pt, height: 100pt)

#rect(fill: pat(relative: "self"), width: 100%, height: 100%, stroke: 1pt)

---
// Test with relative set to `"parent"`
#let pat(..args) = pattern(size: (30pt, 30pt), ..args)[
  #place(top + left, line(start: (0%, 0%), end: (100%, 100%), stroke: 1pt))
  #place(top + left, line(start: (0%, 100%), end: (100%, 0%), stroke: 1pt))
]

#set page(fill: pat(), width: 100pt, height: 100pt)

#rect(fill: pat(relative: "parent"), width: 100%, height: 100%, stroke: 1pt)