diff options
author | 2024-09-10 23:45:33 +0200 | |
---|---|---|
committer | 2024-09-10 23:45:33 +0200 | |
commit | fe8f41278dc922e12ffeb7a50bfb17a47b4bf956 (patch) | |
tree | 66d3455d34f9e1a1ae8d797e6b512853db289b69 /tiny_skia | |
parent | ec39390c23cd46a115bb0528abdb2c5527f1272a (diff) | |
download | iced-fe8f41278dc922e12ffeb7a50bfb17a47b4bf956.tar.gz iced-fe8f41278dc922e12ffeb7a50bfb17a47b4bf956.tar.bz2 iced-fe8f41278dc922e12ffeb7a50bfb17a47b4bf956.zip |
Leverage `stroke` for `stroke_rectangle` in `tiny-skia` backend
Diffstat (limited to 'tiny_skia')
-rw-r--r-- | tiny_skia/src/geometry.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/tiny_skia/src/geometry.rs b/tiny_skia/src/geometry.rs index 532a53cd..0d5fff62 100644 --- a/tiny_skia/src/geometry.rs +++ b/tiny_skia/src/geometry.rs @@ -174,23 +174,7 @@ impl geometry::frame::Backend for Frame { size: Size, stroke: impl Into<Stroke<'a>>, ) { - let Some(path) = convert_path(&Path::rectangle(top_left, size)) - .and_then(|path| path.transform(self.transform)) - else { - return; - }; - - let stroke = stroke.into(); - let skia_stroke = into_stroke(&stroke); - - let mut paint = into_paint(stroke.style); - paint.shader.transform(self.transform); - - self.primitives.push(Primitive::Stroke { - path, - paint, - stroke: skia_stroke, - }); + self.stroke(&Path::rectangle(top_left, size), stroke); } fn fill_text(&mut self, text: impl Into<geometry::Text>) { |