summaryrefslogtreecommitdiff
path: root/tests/typ/layout
diff options
context:
space:
mode:
authorSΓ©bastien d'Herbais de Thun <sebastien.d.herbais@gmail.com>2023-10-10 11:51:22 +0200
committerGitHub <noreply@github.com>2023-10-10 11:51:22 +0200
commit9bca0bce73cffe44dc85fa5f45d1736b473f9823 (patch)
treed8b9ddff8d999a57ad873ee03184817cdfdaaccb /tests/typ/layout
parenta8af6b449ac8ad607595649efde08e2d2b46d668 (diff)
Fix clipping when a box/block has a `radius` (#2338)
Diffstat (limited to 'tests/typ/layout')
-rw-r--r--tests/typ/layout/clip.typ20
1 files changed, 17 insertions, 3 deletions
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)
+)