mirror of
https://github.com/typst/typst
synced 2025-05-21 20:45:27 +08:00
This positions placed elements relative to the real container size instead of relative to the base size of the region. This makes its usage more versatile. Fixes #82 Fixes #685 Fixes #1705
34 lines
566 B
XML
34 lines
566 B
XML
// Test vertical alignment with nested placement.
|
|
|
|
---
|
|
#box(
|
|
fill: aqua,
|
|
width: 30pt,
|
|
height: 30pt,
|
|
place(bottom,
|
|
place(line(start: (0pt, 0pt), end: (20pt, 0pt), stroke: red + 3pt))
|
|
)
|
|
)
|
|
|
|
---
|
|
#box(
|
|
fill: aqua,
|
|
width: 30pt,
|
|
height: 30pt,
|
|
{
|
|
box(fill: yellow, {
|
|
[Hello]
|
|
place(horizon, line(start: (0pt, 0pt), end: (20pt, 0pt), stroke: red + 2pt))
|
|
})
|
|
place(horizon, line(start: (0pt, 0pt), end: (20pt, 0pt), stroke: green + 3pt))
|
|
}
|
|
)
|
|
|
|
---
|
|
#box(fill: aqua)[
|
|
#place(bottom + right)[Hi]
|
|
Hello World \
|
|
How are \
|
|
you?
|
|
]
|