Update tiny-skia and resvg

This commit is contained in:
Héctor Ramón Jiménez 2023-04-26 16:46:27 +02:00
parent e63cc181bd
commit 9c63eb7df5
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
11 changed files with 37 additions and 42 deletions

View file

@ -43,6 +43,8 @@ type ColorFilter = Option<[u8; 4]>;
impl Cache {
/// Load svg
pub fn load(&mut self, handle: &svg::Handle) -> &Svg {
use usvg::TreeParsing;
if self.svgs.contains_key(&handle.id()) {
return self.svgs.get(&handle.id()).unwrap();
}
@ -116,9 +118,9 @@ impl Cache {
resvg::render(
tree,
if width > height {
usvg::FitTo::Width(width)
resvg::FitTo::Width(width)
} else {
usvg::FitTo::Height(height)
resvg::FitTo::Height(height)
},
tiny_skia::Transform::default(),
img.as_mut(),