mirror of
https://github.com/typst/typst
synced 2025-05-13 12:36:23 +08:00
Fix place base
This commit is contained in:
parent
fea238921f
commit
8cbc2ac483
@ -78,7 +78,7 @@ impl Layout for MoveNode {
|
||||
let mut fragment = self.body.layout(vt, styles, regions)?;
|
||||
for frame in &mut fragment {
|
||||
let delta = self.delta.resolve(styles);
|
||||
let delta = delta.zip(frame.size()).map(|(d, s)| d.relative_to(s));
|
||||
let delta = delta.zip(regions.base).map(|(d, s)| d.relative_to(s));
|
||||
frame.translate(delta.to_point());
|
||||
}
|
||||
Ok(fragment)
|
||||
|
BIN
tests/ref/bugs/place-base.png
Normal file
BIN
tests/ref/bugs/place-base.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
7
tests/typ/bugs/place-base.typ
Normal file
7
tests/typ/bugs/place-base.typ
Normal file
@ -0,0 +1,7 @@
|
||||
// Test that placement is relative to container and not itself.
|
||||
|
||||
---
|
||||
#set page(height: 80pt, margin: 0pt)
|
||||
#place(right, dx: -70%, dy: 20%, [First])
|
||||
#place(left, dx: 20%, dy: 60%, [Second])
|
||||
#place(center + horizon, dx: 25%, dy: 25%, [Third])
|
Loading…
x
Reference in New Issue
Block a user