From 9bca0bce73cffe44dc85fa5f45d1736b473f9823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20d=27Herbais=20de=20Thun?= Date: Tue, 10 Oct 2023 11:51:22 +0200 Subject: Fix clipping when a box/block has a `radius` (#2338) --- crates/typst-library/src/visualize/image.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/typst-library/src/visualize') 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. -- cgit v1.2.3