From 6f910f60e9740e2a28a164c04475f7ea853673bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bennet=20Ble=C3=9Fmann?= <3877590+Skgland@users.noreply.github.com> Date: Thu, 24 Apr 2025 14:50:34 +0200 Subject: [PATCH] Protect against NaN in hit-test code (#6851) * Closes * [x] I have followed the instructions in the PR template --- crates/egui/src/hit_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/hit_test.rs b/crates/egui/src/hit_test.rs index e7917212..2f0edcfa 100644 --- a/crates/egui/src/hit_test.rs +++ b/crates/egui/src/hit_test.rs @@ -65,7 +65,7 @@ pub fn hit_test( .filter(|layer| layer.order.allow_interaction()) .flat_map(|&layer_id| widgets.get_layer(layer_id)) .filter(|&w| { - if w.interact_rect.is_negative() { + if w.interact_rect.is_negative() || w.interact_rect.any_nan() { return false; }