summaryrefslogtreecommitdiff
path: root/tests/typ/insert/circle.typ
blob: d2fa928e41d8e08cacd66ba3df2d2a425efbc89d (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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Test the `circle` function.

---
// Test auto sizing.

Auto-sized circle. \
#circle(fill: #eb5278, align(center, center, [But, soft!]))

Center-aligned rect in auto-sized circle.
#circle(fill: forest)[
    #align(center, center)
    #rect(fill: conifer, pad(5pt)[But, soft!])
]

100%-width rect in auto-sized circle. \
#circle(fill: forest, rect(width: 100%, fill: conifer)[
    But, soft! what light through yonder window breaks?
])

Expanded by height.
#circle(fill: conifer)[A \ B \ C]

---
// Test relative sizing.
#rect(width: 100%, height: 50pt, fill: #aaa)[
    #align(center, center)
    #font(color: #fff)
    #circle(radius: 10pt, fill: eastern)[A]
    #circle(height: 60%, fill: eastern)[B]
    #circle(width: 20% + 20pt, fill: eastern)[C]
]

---
// Radius wins over width and height.
// Error: 2:23-2:34 unexpected argument
// Error: 1:36-1:49 unexpected argument
#circle(radius: 10pt, width: 50pt, height: 100pt, fill: eastern)

// Width wins over height.
// Error: 22-34 unexpected argument
#circle(width: 20pt, height: 50pt, fill: eastern)