diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-17 17:09:19 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-11-17 17:09:19 +0100 |
| commit | 89f2e71852e96062ea9b756bf92fbf4e894871b1 (patch) | |
| tree | 836099ebd17adf30a24fc62464dfdd3d9c248480 /tests/typ/elements/circle.typ | |
| parent | 9a800daa82833c57eee04e92c701ca9a05a67d3b (diff) | |
Align node
Diffstat (limited to 'tests/typ/elements/circle.typ')
| -rw-r--r-- | tests/typ/elements/circle.typ | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/typ/elements/circle.typ b/tests/typ/elements/circle.typ index 4413d0d9..5be9cf56 100644 --- a/tests/typ/elements/circle.typ +++ b/tests/typ/elements/circle.typ @@ -9,8 +9,7 @@ Auto-sized circle. \ #circle(fill: rgb("eb5278"))[ - #align(center, center) - But, soft! + #align(center, center)[But, soft!] ] Center-aligned rect in auto-sized circle. @@ -31,14 +30,18 @@ Expanded by height. #circle(fill: conifer)[A \ B \ C] --- +// Ensure circle directly in rect works. +#rect(width: 40pt, height: 30pt, circle(fill: forest)) + +--- // Test relative sizing. -#rect(width: 100pt, height: 50pt, fill: rgb("aaa"))[ - #align(center, center) - #font(fill: white) - #circle(radius: 10pt, fill: eastern)[A] // D=20pt - #circle(height: 60%, fill: eastern)[B] // D=30pt - #circle(width: 20% + 20pt, fill: eastern)[C] // D=40pt -] +#let centered(body) = align(center, center, body) +#font(fill: white) +#rect(width: 100pt, height: 50pt, fill: rgb("aaa"), centered[ + #circle(radius: 10pt, fill: eastern, centered[A]) // D=20pt + #circle(height: 60%, fill: eastern, centered[B]) // D=30pt + #circle(width: 20% + 20pt, fill: eastern, centered[C]) // D=40pt +]) --- // Radius wins over width and height. |
