1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 15:20:05 -04:00
Files
egui/crates/egui
Emil Ernerfeldt 1a9d2af9ef Fix panic in hit-test when a widget rect contains a NaN (#8479)
* Closes <https://github.com/emilk/egui/issues/7870>
* [x] I have followed the instructions in the PR template

`WidgetRect` derives `PartialEq`, so a rect with a NaN coordinate is not
equal even to itself, and `close.iter().position(|w| *w ==
hit_click).unwrap()` panicked. We now look the hit up by id.

NaN rects got that far because `Rect::intersect` scrubs NaNs
(`f32::max(NAN, x) == x`), so `interact_rect` can be finite while `rect`
is not, sneaking past the existing NaN guard. Hit-testing now discards
those widgets too.

Finally, `Pos2` claims `Eq` while NaN breaks reflexivity, so `PartialEq`
is now hand-written and panics on NaN in debug builds.
2026-09-03 13:16:14 +00:00
..

GUI implementation

This is the core library crate egui. It is fully platform independent without any backend. You give the egui library input each frame (mouse pos etc), and it outputs a triangle mesh for you to paint.