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 /crates/typst-library/src/visualize | |
| parent | a8af6b449ac8ad607595649efde08e2d2b46d668 (diff) | |
Fix clipping when a box/block has a `radius` (#2338)
Diffstat (limited to 'crates/typst-library/src/visualize')
| -rw-r--r-- | crates/typst-library/src/visualize/image.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/typst-library/src/visualize/image.rs b/crates/typst-library/src/visualize/image.rs index b0c9d8ea..05a9c352 100644 --- a/crates/typst-library/src/visualize/image.rs +++ b/crates/typst-library/src/visualize/image.rs @@ -1,7 +1,7 @@ use std::ffi::OsStr; use std::path::Path; -use typst::geom::Smart; +use typst::geom::{self, Smart}; use typst::image::{Image, ImageFormat, RasterFormat, VectorFormat}; use typst::util::option_eq; @@ -212,7 +212,7 @@ impl Layout for ImageElem { // Create a clipping group if only part of the image should be visible. if fit == ImageFit::Cover && !target.fits(fitted) { - frame.clip(); + frame.clip(geom::Path::rect(frame.size())); } // Apply metadata. |
