From c474d6bcebc379d6767f46b2bac468a4a9547c17 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:30:12 +0900 Subject: [PATCH 1/2] Update context.rs --- crates/egui/src/context.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index d1a05db4bc2..f7c61cacd7a 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -1926,10 +1926,10 @@ impl Context { paint_widget_id(widget, "hovered", Color32::WHITE); } } - for &widget in &clicked { + while let Some(widget) = clicked { paint_widget_id(widget, "clicked", Color32::RED); } - for &widget in &dragged { + while let Some(widget) = dragged { paint_widget_id(widget, "dragged", Color32::GREEN); } } @@ -1948,10 +1948,10 @@ impl Context { paint_widget(widget, "contains_pointer", Color32::BLUE); } } - for widget in &click { + while let Some(widget) = &click { paint_widget(widget, "click", Color32::RED); } - for widget in &drag { + while let Some(widget) = &drag { paint_widget(widget, "drag", Color32::GREEN); } } From eb7b280af1b2b3dde64b909c7ab276422c42dfb1 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:10:42 +0900 Subject: [PATCH 2/2] Update context.rs --- crates/egui/src/context.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index f7c61cacd7a..a4ca219a1b4 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -1926,10 +1926,10 @@ impl Context { paint_widget_id(widget, "hovered", Color32::WHITE); } } - while let Some(widget) = clicked { + if let Some(widget) = clicked { paint_widget_id(widget, "clicked", Color32::RED); } - while let Some(widget) = dragged { + if let Some(widget) = dragged { paint_widget_id(widget, "dragged", Color32::GREEN); } } @@ -1948,10 +1948,10 @@ impl Context { paint_widget(widget, "contains_pointer", Color32::BLUE); } } - while let Some(widget) = &click { + if let Some(widget) = &click { paint_widget(widget, "click", Color32::RED); } - while let Some(widget) = &drag { + if let Some(widget) = &drag { paint_widget(widget, "drag", Color32::GREEN); } }