summaryrefslogtreecommitdiff
path: root/crates/typst-render/src/shape.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-render/src/shape.rs')
-rw-r--r--crates/typst-render/src/shape.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/typst-render/src/shape.rs b/crates/typst-render/src/shape.rs
index ba7ed6d8..9b50d5f1 100644
--- a/crates/typst-render/src/shape.rs
+++ b/crates/typst-render/src/shape.rs
@@ -69,9 +69,11 @@ pub fn render_shape(canvas: &mut sk::Pixmap, state: State, shape: &Shape) -> Opt
let dash = dash.as_ref().and_then(to_sk_dash_pattern);
let bbox = shape.geometry.bbox_size();
- let offset_bbox = (!matches!(shape.geometry, Geometry::Line(..)))
- .then(|| offset_bounding_box(bbox, *thickness))
- .unwrap_or(bbox);
+ let offset_bbox = if !matches!(shape.geometry, Geometry::Line(..)) {
+ offset_bounding_box(bbox, *thickness)
+ } else {
+ bbox
+ };
let fill_transform =
(!matches!(shape.geometry, Geometry::Line(..))).then(|| {