Merge pull request #2954 from semiversus/fix_scaling_artifacts
Fix `svg` scaling in `iced_tiny_skia`
This commit is contained in:
commit
9de2261230
2 changed files with 8 additions and 5 deletions
|
|
@ -627,7 +627,7 @@ impl Engine {
|
||||||
self.vector_pipeline.draw(
|
self.vector_pipeline.draw(
|
||||||
&svg.handle,
|
&svg.handle,
|
||||||
svg.color,
|
svg.color,
|
||||||
physical_bounds,
|
*bounds,
|
||||||
svg.opacity,
|
svg.opacity,
|
||||||
_pixels,
|
_pixels,
|
||||||
transform,
|
transform,
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,20 @@ impl Pipeline {
|
||||||
if let Some(image) = self.cache.borrow_mut().draw(
|
if let Some(image) = self.cache.borrow_mut().draw(
|
||||||
handle,
|
handle,
|
||||||
color,
|
color,
|
||||||
Size::new(bounds.width as u32, bounds.height as u32),
|
Size::new(
|
||||||
|
(bounds.width * transform.sx) as u32,
|
||||||
|
(bounds.height * transform.sy) as u32,
|
||||||
|
),
|
||||||
) {
|
) {
|
||||||
pixels.draw_pixmap(
|
pixels.draw_pixmap(
|
||||||
bounds.x as i32,
|
(bounds.x * transform.sx) as i32,
|
||||||
bounds.y as i32,
|
(bounds.y * transform.sy) as i32,
|
||||||
image,
|
image,
|
||||||
&tiny_skia::PixmapPaint {
|
&tiny_skia::PixmapPaint {
|
||||||
opacity,
|
opacity,
|
||||||
..tiny_skia::PixmapPaint::default()
|
..tiny_skia::PixmapPaint::default()
|
||||||
},
|
},
|
||||||
transform,
|
Transform::default(),
|
||||||
clip_mask,
|
clip_mask,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue