From c176f0c4714ccc9ec25e48c63baa218bc98974a2 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:59:45 +0900 Subject: [PATCH 1/7] Response Sense Recognition Issue Closes #3989 --- crates/egui/src/response.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index 2b55a9d53d6..f944587ced1 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -596,13 +596,14 @@ impl Response { /// ``` #[must_use] pub fn interact(&self, sense: Sense) -> Self { - self.ctx.interact_with_hovered( + self.ctx.interact( + self.rect, + self.ctx.style().spacing.item_spacing, self.layer_id, self.id, self.rect, sense, self.enabled, - self.hovered, ) } From 7350acc3bd9b173a90c1a4ca68ddce07af3f1606 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Thu, 8 Feb 2024 23:43:48 +0900 Subject: [PATCH 2/7] Update response.rs --- crates/egui/src/response.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index f944587ced1..2834b93c6aa 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -597,7 +597,7 @@ impl Response { #[must_use] pub fn interact(&self, sense: Sense) -> Self { self.ctx.interact( - self.rect, + self.ctx.layer_painter(self.layer_id).clip_rect(), self.ctx.style().spacing.item_spacing, self.layer_id, self.id, From 1e1dd0c5f7d31138460e2df90509ea49c2b62713 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:57:19 +0900 Subject: [PATCH 3/7] Update response.rs --- crates/egui/src/response.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index 2834b93c6aa..2a4a7e120c4 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -596,6 +596,15 @@ impl Response { /// ``` #[must_use] pub fn interact(&self, sense: Sense) -> Self { + self.ctx.interact_with_hovered( + self.layer_id, + self.id, + self.rect, + sense, + self.enabled, + self.hovered, + ) + /* self.ctx.interact( self.ctx.layer_painter(self.layer_id).clip_rect(), self.ctx.style().spacing.item_spacing, @@ -605,6 +614,7 @@ impl Response { sense, self.enabled, ) + */ } /// Adjust the scroll position until this UI becomes visible. From 163162301a072f54c3b986087d395ed3893b9554 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:39:51 +0900 Subject: [PATCH 4/7] Update image.rs --- crates/egui/src/widgets/image.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/image.rs b/crates/egui/src/widgets/image.rs index d055fee350f..c94da2f3c55 100644 --- a/crates/egui/src/widgets/image.rs +++ b/crates/egui/src/widgets/image.rs @@ -334,7 +334,7 @@ impl<'a> Widget for Image<'a> { let original_image_size = tlr.as_ref().ok().and_then(|t| t.size()); let ui_size = self.calc_size(ui.available_size(), original_image_size); - let (rect, response) = ui.allocate_exact_size(ui_size, self.sense); + let (rect, response) = ui.allocate_exact_size(ui_size, Sense::click_and_drag()); if ui.is_rect_visible(rect) { paint_texture_load_result( ui, From a911ad14da5c2b92a16c23833ece6641f3b22ba7 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:41:07 +0900 Subject: [PATCH 5/7] Update response.rs --- crates/egui/src/response.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index 2a4a7e120c4..2b55a9d53d6 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -604,17 +604,6 @@ impl Response { self.enabled, self.hovered, ) - /* - self.ctx.interact( - self.ctx.layer_painter(self.layer_id).clip_rect(), - self.ctx.style().spacing.item_spacing, - self.layer_id, - self.id, - self.rect, - sense, - self.enabled, - ) - */ } /// Adjust the scroll position until this UI becomes visible. From 0c3a33daafc36380b8163a653bae280e4a2ba724 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Sat, 10 Feb 2024 09:16:59 +0900 Subject: [PATCH 6/7] Update image.rs --- crates/egui/src/widgets/image.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/image.rs b/crates/egui/src/widgets/image.rs index c94da2f3c55..9277e151bde 100644 --- a/crates/egui/src/widgets/image.rs +++ b/crates/egui/src/widgets/image.rs @@ -334,7 +334,7 @@ impl<'a> Widget for Image<'a> { let original_image_size = tlr.as_ref().ok().and_then(|t| t.size()); let ui_size = self.calc_size(ui.available_size(), original_image_size); - let (rect, response) = ui.allocate_exact_size(ui_size, Sense::click_and_drag()); + let (rect, response) = ui.allocate_exact_size(ui_size, Sense::click); if ui.is_rect_visible(rect) { paint_texture_load_result( ui, From e570b2eab60eca6ca74f20608a474a9bfefadd27 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Sat, 10 Feb 2024 09:23:21 +0900 Subject: [PATCH 7/7] Update image.rs --- crates/egui/src/widgets/image.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/image.rs b/crates/egui/src/widgets/image.rs index 9277e151bde..cba78b0c79b 100644 --- a/crates/egui/src/widgets/image.rs +++ b/crates/egui/src/widgets/image.rs @@ -334,7 +334,7 @@ impl<'a> Widget for Image<'a> { let original_image_size = tlr.as_ref().ok().and_then(|t| t.size()); let ui_size = self.calc_size(ui.available_size(), original_image_size); - let (rect, response) = ui.allocate_exact_size(ui_size, Sense::click); + let (rect, response) = ui.allocate_exact_size(ui_size, Sense::click()); if ui.is_rect_visible(rect) { paint_texture_load_result( ui,