We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be1c78f commit 42d9938Copy full SHA for 42d9938
1 file changed
src/widglets/mod.rs
@@ -34,6 +34,10 @@ pub fn svg_path_to_handle(path: PathBuf) -> Result<iced::widget::image::Handle,
34
.ok_or("Can create pixmap")?;
35
36
let svg_size = tree.size();
37
+ if svg_size.width() == 0.0 || svg_size.height() == 0.0 {
38
+ return Err(String::from("Svg size or width was zero! Cannot scale"));
39
+ }
40
+
41
let transform = resvg::tiny_skia::Transform::from_scale(
42
SVG_WIDTH as f32 / svg_size.width(),
43
SVG_HEIGHT as f32 / svg_size.height(),
0 commit comments