mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 15:20:05 -04:00
* 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.