diff options
| author | SΓ©bastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2023-10-10 11:51:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-10 11:51:22 +0200 |
| commit | 9bca0bce73cffe44dc85fa5f45d1736b473f9823 (patch) | |
| tree | d8b9ddff8d999a57ad873ee03184817cdfdaaccb /tests | |
| parent | a8af6b449ac8ad607595649efde08e2d2b46d668 (diff) | |
Fix clipping when a box/block has a `radius` (#2338)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/layout/clip.png | bin | 25673 -> 29586 bytes | |||
| -rw-r--r-- | tests/typ/layout/clip.typ | 20 |
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/ref/layout/clip.png b/tests/ref/layout/clip.png Binary files differindex 53565a98..c847fc63 100644 --- a/tests/ref/layout/clip.png +++ b/tests/ref/layout/clip.png diff --git a/tests/typ/layout/clip.typ b/tests/typ/layout/clip.typ index 3baa8b80..d05fdb74 100644 --- a/tests/typ/layout/clip.typ +++ b/tests/typ/layout/clip.typ @@ -7,13 +7,13 @@ world 1 Space -Hello #box(width: 1em, height: 1em, clip: true)[#rect(width: 3em, height: 3em, fill: red)] +Hello #box(width: 1em, height: 1em, clip: true)[#rect(width: 3em, height: 3em, fill: red)] world 2 --- // Test cliping text #block(width: 5em, height: 2em, clip: false, stroke: 1pt + black)[ - But, soft! what light through + But, soft! what light through ] #v(2em) @@ -24,7 +24,7 @@ world 2 ] --- -// Test cliping svg glyphs +// Test clipping svg glyphs Emoji: #box(height: 0.5em, stroke: 1pt + black)[πͺ, π, π] Emoji: #box(height: 0.5em, clip: true, stroke: 1pt + black)[πͺ, π, π] @@ -40,3 +40,17 @@ First! But, soft! what light through yonder window breaks? It is the east, and Juliet is the sun. ] + +--- +// Test clipping with `radius`. + +#set page(height: 60pt) + +#box( + radius: 5pt, + stroke: 2pt + black, + width: 20pt, + height: 20pt, + clip: true, + image("/files/rhino.png", width: 30pt) +) |
