From a50a56a29d7068b523bcbecd9313bbd5f165e447 Mon Sep 17 00:00:00 2001 From: Thomas Gatzweiler Date: Tue, 1 Apr 2025 13:29:33 +0200 Subject: [PATCH] fix(tiny-skia): correct stroke bounds calculation --- tiny_skia/src/engine.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tiny_skia/src/engine.rs b/tiny_skia/src/engine.rs index 44c22be0..8dc21b61 100644 --- a/tiny_skia/src/engine.rs +++ b/tiny_skia/src/engine.rs @@ -538,10 +538,10 @@ impl Engine { let bounds = path.bounds(); Rectangle { - x: bounds.x(), - y: bounds.y(), - width: bounds.width(), - height: bounds.height(), + x: bounds.x() - stroke.width / 2.0, + y: bounds.y() - stroke.width / 2.0, + width: bounds.width() + stroke.width, + height: bounds.height() + stroke.width, } * transformation };