diff --git a/Cargo.lock b/Cargo.lock index a526be8c8f..89c38a10f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4474,7 +4474,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1fcfcd44ca6e90c921fee9fa665d530b21ef1327a4c1a6c5250ea44b776ada7" dependencies = [ - "roxmltree 0.20.0", + "roxmltree", ] [[package]] @@ -5814,9 +5814,9 @@ dependencies = [ [[package]] name = "imagesize" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" [[package]] name = "imgref" @@ -9793,9 +9793,9 @@ dependencies = [ [[package]] name = "resvg" -version = "0.41.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2327ced609dadeed3e9702fec3e6b2ddd208758a9268d13e06566c6101ba533" +checksum = "4a325d5e8d1cebddd070b13f44cec8071594ab67d1012797c121f27a669b7958" dependencies = [ "log", "pico-args", @@ -9948,12 +9948,6 @@ dependencies = [ "util", ] -[[package]] -name = "roxmltree" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" - [[package]] name = "roxmltree" version = "0.20.0" @@ -13210,9 +13204,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "usvg" -version = "0.41.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c704361d822337cfc00387672c7b59eaa72a1f0744f62b2a68aa228a0c6927d" +checksum = "7447e703d7223b067607655e625e0dbca80822880248937da65966194c4864e6" dependencies = [ "base64 0.22.1", "data-url", @@ -13221,7 +13215,7 @@ dependencies = [ "kurbo", "log", "pico-args", - "roxmltree 0.19.0", + "roxmltree", "simplecss", "siphasher 1.0.1", "strict-num", diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index b7fafb8058..3a4fdd5014 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -90,8 +90,8 @@ profiling.workspace = true rand = { optional = true, workspace = true } raw-window-handle = "0.6" refineable.workspace = true -resvg = { version = "0.41.0", default-features = false } -usvg = { version = "0.41.0", default-features = false } +resvg = { version = "0.44.0", default-features = false } +usvg = { version = "0.44.0", default-features = false } schemars.workspace = true seahash = "4.1" semantic_version.workspace = true diff --git a/crates/gpui/src/svg_renderer.rs b/crates/gpui/src/svg_renderer.rs index c465eec784..a5cbb67372 100644 --- a/crates/gpui/src/svg_renderer.rs +++ b/crates/gpui/src/svg_renderer.rs @@ -60,10 +60,8 @@ impl SvgRenderer { let mut pixmap = resvg::tiny_skia::Pixmap::new(size.width.into(), size.height.into()) .ok_or(usvg::Error::InvalidSize)?; - let transform = tree.view_box().to_transform( - resvg::tiny_skia::Size::from_wh(size.width.0 as f32, size.height.0 as f32) - .ok_or(usvg::Error::InvalidSize)?, - ); + let scale = size.width.0 as f32 / tree.size().width(); + let transform = resvg::tiny_skia::Transform::from_scale(scale, scale); resvg::render(&tree, transform, &mut pixmap.as_mut());