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 }; diff --git a/tiny_skia/src/layer.rs b/tiny_skia/src/layer.rs index 5f3979bf..d39278b2 100644 --- a/tiny_skia/src/layer.rs +++ b/tiny_skia/src/layer.rs @@ -191,7 +191,7 @@ impl Layer { ) { self.primitives.push(Item::Group( primitives, - clip_bounds, + clip_bounds * transformation, transformation, )); } @@ -204,7 +204,7 @@ impl Layer { ) { self.primitives.push(Item::Cached( primitives, - clip_bounds, + clip_bounds * transformation, transformation, )); }