egui icon indicating copy to clipboard operation
egui copied to clipboard

Zooming out crashes `egui_plot`

Open danielfaust opened this issue 2 years ago • 2 comments

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:

  1. Go to https://www.egui.rs/#Demo
  2. Click on Plot in the left pane
  3. Click on Custom Axes in the Plot window
  4. 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

danielfaust avatar Nov 28 '23 15:11 danielfaust

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

Firepal avatar Dec 11 '23 19:12 Firepal

Very similar to:

  • https://github.com/emilk/egui/issues/3462

emilk avatar Dec 28 '23 08:12 emilk

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

Screenshot 2024-02-01 at 10 22 17 Screenshot 2024-02-01 at 10 22 24

Tweoss avatar Feb 01 '24 18:02 Tweoss

I think this is fixed now

emilk avatar Jul 15 '24 17:07 emilk

I can no longer find any plots in the demo. Have they been removed?

danielfaust avatar Jul 16 '24 08:07 danielfaust