Describe the bug
The initial frame in the images example results in a size_hint of [4984.0, 0.0] passed to the ferris SVG. Prior to #3719 an invalid size hint for a SVG would error out while creating the pixmap, but now it runs into an unwrap on creating an IntSize, triggering a panic.
To Reproduce
Steps to reproduce the behavior:
- Checkout
0.25.0 or 963be24
- Add
cc.egui_ctx.set_pixels_per_point(2.0); to the app creator in examples/images/src/main.rs
- Run the example with
cargo run -p images
- Get
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', crates\egui_extras\src\image.rs:248:83 at IntSize::from_wh(w, h).unwrap() because h is 0 from available_size
Expected behavior
There is no panic
Desktop (please complete the following information):
- OS: Windows
- Version 0.25.0
Describe the bug
The initial frame in the
imagesexample results in a size_hint of[4984.0, 0.0]passed to the ferris SVG. Prior to #3719 an invalid size hint for a SVG would error out while creating the pixmap, but now it runs into an unwrap on creating an IntSize, triggering a panic.To Reproduce
Steps to reproduce the behavior:
0.25.0or 963be24cc.egui_ctx.set_pixels_per_point(2.0);to the app creator inexamples/images/src/main.rscargo run -p imagesthread 'main' panicked at 'called `Option::unwrap()` on a `None` value', crates\egui_extras\src\image.rs:248:83atIntSize::from_wh(w, h).unwrap()becausehis 0 fromavailable_sizeExpected behavior
There is no panic
Desktop (please complete the following information):