Panic when zooming out a plot too far
I wasn't able to check if it is present on main by reproducing it but the code that causes the panic is still there.
Describe the bug
I was experimenting with zooming using the right mouse button. And while doing so seems I hit an edge case and the program suddenly closed. Checking the console I discovered that it had panicked. Seem I managed to accidentally try to zoom by exactly 0.0 and there is an assert to check that the amount is not 0.0 hence it crashed. While this is hard to recreate it is not impossible, might be worth adding a check before calling next_power so that it doesn't panic but instead does nothing as that seems to make sense for a zoom by 0.
Error message:
thread 'main' panicked at /home/one/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui_plot-0.23.0/src/lib.rs:1877:5:
assertion `left != right` failed
left: -0.0
right: 0.0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
To Reproduce Given the nature of the bug I was unable to reproduce it as it requires zooming on a plot with the right mouse button and getting exactly 0 for the amount of zoom.
Expected behavior
I think nothing should happen instead of a panic as the user may trigger this (even though it is unlikely)
Screenshots N/A
Desktop (please complete the following information):
- OS: Ubuntu 22.04.01
- Browser: N/A running native when crashed
- Version: 23