Fix svg scaling in iced_tiny_skia

This commit is contained in:
Günther Jena 2025-05-21 20:49:21 +02:00 committed by Héctor Ramón Jiménez
parent 6bbe189809
commit 8cae3fca48
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 8 additions and 5 deletions

View file

@ -627,7 +627,7 @@ impl Engine {
self.vector_pipeline.draw(
&svg.handle,
svg.color,
physical_bounds,
*bounds,
svg.opacity,
_pixels,
transform,

View file

@ -42,17 +42,20 @@ impl Pipeline {
if let Some(image) = self.cache.borrow_mut().draw(
handle,
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(
bounds.x as i32,
bounds.y as i32,
(bounds.x * transform.sx) as i32,
(bounds.y * transform.sy) as i32,
image,
&tiny_skia::PixmapPaint {
opacity,
..tiny_skia::PixmapPaint::default()
},
transform,
Transform::default(),
clip_mask,
);
}