Leverage stroke for stroke_rectangle in tiny-skia backend

This commit is contained in:
Héctor Ramón Jiménez 2024-09-10 23:45:33 +02:00
parent ec39390c23
commit fe8f41278d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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>) {