From 65e4e7bf15c28f90b7652912ecaae06408eeb773 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 1 Nov 2022 10:44:33 +0100 Subject: [PATCH] Bump resvg/usvg/tiny-skia dependencies --- internal/compiler/Cargo.toml | 6 +++--- internal/compiler/passes/embed_images.rs | 2 +- internal/core/Cargo.toml | 10 +++++----- internal/core/graphics/image/svg.rs | 5 ++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/internal/compiler/Cargo.toml b/internal/compiler/Cargo.toml index d08cf04f7..0d88c0ba3 100644 --- a/internal/compiler/Cargo.toml +++ b/internal/compiler/Cargo.toml @@ -55,9 +55,9 @@ fontdue = { version = "0.7.1" } # for processing and embedding the rendered image (texture) [target.'cfg(not(target_arch = "wasm32"))'.dependencies] image = "0.24" -tiny-skia = "0.6.1" -resvg = "0.23" -usvg = "0.23" +tiny-skia = "0.8.2" +resvg = "0.25" +usvg = "0.25" [target.'cfg(not(any(target_family = "windows", target_os = "macos", target_os = "ios", target_arch = "wasm32")))'.dependencies] libc = { version = "0.2" } diff --git a/internal/compiler/passes/embed_images.rs b/internal/compiler/passes/embed_images.rs index 38f586303..046ae9f04 100644 --- a/internal/compiler/passes/embed_images.rs +++ b/internal/compiler/passes/embed_images.rs @@ -282,7 +282,7 @@ fn load_image( )) })?; // TODO: ideally we should find the size used for that `Image` - let original_size = tree.svg_node().size; + let original_size = tree.size; let width = original_size.width() * scale_factor; let height = original_size.height() * scale_factor; diff --git a/internal/core/Cargo.toml b/internal/core/Cargo.toml index f5beea94d..0cdc2e286 100644 --- a/internal/core/Cargo.toml +++ b/internal/core/Cargo.toml @@ -73,9 +73,9 @@ integer-sqrt = { version = "0.1.5" } image = { version = "0.24.0", optional = true, default-features = false, features = [ "png", "jpeg" ] } clru = { version = "0.6.0", optional = true } -resvg = { version= "0.23", optional = true, default-features = false } -usvg = { version= "0.23", optional = true, default-features = false, features = ["text"] } -tiny-skia = { version= "0.6.1", optional = true, default-features = false } +resvg = { version= "0.25", optional = true, default-features = false } +usvg = { version= "0.25", optional = true, default-features = false, features = ["text"] } +tiny-skia = { version= "0.8.2", optional = true, default-features = false } [target.'cfg(target_arch = "wasm32")'.dependencies] instant = { version = "0.1", features = [ "wasm-bindgen", "now" ] } @@ -83,7 +83,7 @@ wasm-bindgen = { version = "0.2" } web-sys = { version = "0.3", features = [ "HtmlImageElement" ] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -usvg = { version= "0.23", optional = true, default-features = false, features = ["text", "memmap-fonts"] } +usvg = { version= "0.25", optional = true, default-features = false, features = ["text", "memmap-fonts"] } [dev-dependencies] slint = { path = "../../api/rs/slint", default-features = false, features = ["std", "compat-0-3-0"] } @@ -94,4 +94,4 @@ fontdb = { version = "0.9.3" } image = { version = "0.24.0", default-features = false, features = [ "png" ] } pin-weak = "1" -tiny-skia = "0.6.1" +tiny-skia = "0.8.2" diff --git a/internal/core/graphics/image/svg.rs b/internal/core/graphics/image/svg.rs index bd8c39ec3..4f2194ce3 100644 --- a/internal/core/graphics/image/svg.rs +++ b/internal/core/graphics/image/svg.rs @@ -31,7 +31,7 @@ impl core::fmt::Debug for ParsedSVG { impl ParsedSVG { pub fn size(&self) -> crate::graphics::IntSize { - let size = self.svg_tree.svg_node().size.to_screen_size(); + let size = self.svg_tree.size.to_screen_size(); [size.width(), size.height()].into() } @@ -46,8 +46,7 @@ impl ParsedSVG { ) -> Result { let tree = &self.svg_tree; let fit = usvg::FitTo::Size(size.width, size.height); - let size = - fit.fit_to(tree.svg_node().size.to_screen_size()).ok_or(usvg::Error::InvalidSize)?; + let size = fit.fit_to(tree.size.to_screen_size()).ok_or(usvg::Error::InvalidSize)?; let mut buffer = SharedPixelBuffer::new(size.width(), size.height()); let skia_buffer = tiny_skia::PixmapMut::from_bytes(buffer.make_mut_bytes(), size.width(), size.height())