egui
egui copied to clipboard
Zooming out crashes `egui_plot`
Describe the bug
In the demo located at https://www.egui.rs/#Demo, when fully zooming out from the "Custom Axes" plot example in the "Plot" window, egui will crash with a "The egui app has crashed." message
To Reproduce
Steps to reproduce the behavior:
- Go to https://www.egui.rs/#Demo
- Click on Plot in the left pane
- Click on Custom Axes in the Plot window
- Fully scroll out with the mouse wheel while pressing Ctrl
Desktop
- Windows 11
- Google Chrome
- Version 119.0.6045.160 (Offizieller Build) (64-Bit)
Desktop
- Ubuntu 22.04
- Firefox
- Version 120.0 (64-Bit) canonical-002-1.0 (Mozilla Firefox Snap for Ubuntu)
Smartphone
Not reproducible due to pinch and zoom not being able to fully zoom out
Relevant: https://github.com/emilk/egui/blob/8d4de866d4da1835b31e85f9068a5257e6ccbccb/crates/egui_demo_lib/src/demo/plot_demo.rs#L478-L510
It's very much possible that this is trying to draw many, many grid marks
Very similar to:
- https://github.com/emilk/egui/issues/3462
It does seem like the custom axes demo tries to draw many grid marks when zoomed out.
In the normal plot demo, when zooming out, I get the below. Presumably, NaN is compared against another floating point number, and the inequality doesn't hold in line 1916. https://github.com/emilk/egui/blob/520b28ce22a0daa20e13767af6061e9e40796f2a/crates/egui_plot/src/lib.rs#L1915-L1925
I think this is fixed now
I can no longer find any plots in the demo. Have they been removed?