Leverage stroke for stroke_rectangle in tiny-skia backend
This commit is contained in:
parent
ec39390c23
commit
fe8f41278d
1 changed files with 1 additions and 17 deletions
|
|
@ -174,23 +174,7 @@ impl geometry::frame::Backend for Frame {
|
||||||
size: Size,
|
size: Size,
|
||||||
stroke: impl Into<Stroke<'a>>,
|
stroke: impl Into<Stroke<'a>>,
|
||||||
) {
|
) {
|
||||||
let Some(path) = convert_path(&Path::rectangle(top_left, size))
|
self.stroke(&Path::rectangle(top_left, size), stroke);
|
||||||
.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,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fill_text(&mut self, text: impl Into<geometry::Text>) {
|
fn fill_text(&mut self, text: impl Into<geometry::Text>) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue