diff options
author | 2023-05-11 12:25:43 -0400 | |
---|---|---|
committer | 2023-05-11 12:25:43 -0400 | |
commit | 5ee26cc8ec1a49c78d1f3f99ebf6696f827ea5d1 (patch) | |
tree | 466e1b7f69a7f0f9b96529208213ccbab76ebca3 /tiny_skia | |
parent | 46fc5a7992001ca8de6966d182ab9dba33d6742e (diff) | |
download | iced-5ee26cc8ec1a49c78d1f3f99ebf6696f827ea5d1.tar.gz iced-5ee26cc8ec1a49c78d1f3f99ebf6696f827ea5d1.tar.bz2 iced-5ee26cc8ec1a49c78d1f3f99ebf6696f827ea5d1.zip |
fix: don't offset fill of quad
Diffstat (limited to 'tiny_skia')
-rw-r--r-- | tiny_skia/src/backend.rs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tiny_skia/src/backend.rs b/tiny_skia/src/backend.rs index 58721a80..583b8dac 100644 --- a/tiny_skia/src/backend.rs +++ b/tiny_skia/src/backend.rs @@ -178,21 +178,13 @@ impl Backend { .min(bounds.width / 2.0) .min(bounds.height / 2.0); - // Offset the fill by the border width - let path_bounds = Rectangle { - x: bounds.x + border_width, - y: bounds.y + border_width, - width: bounds.width - 2.0 * border_width, - height: bounds.height - 2.0 * border_width, - }; - // fill border radius is the border radius minus the border width let mut fill_border_radius = *border_radius; for radius in &mut fill_border_radius { - *radius = (*radius - border_width / 2.0) - .min(path_bounds.width / 2.0) - .min(path_bounds.height / 2.0); + *radius = (*radius) + .min(bounds.width / 2.0) + .min(bounds.height / 2.0); } - let path = rounded_rectangle(path_bounds, fill_border_radius); + let path = rounded_rectangle(*bounds, fill_border_radius); pixels.fill_path( &path, |