From eb7ca72534f678c7ed7bea8f080e850c0b0f7eaa Mon Sep 17 00:00:00 2001 From: Adrian Blumer Date: Mon, 17 Mar 2025 02:00:47 -0700 Subject: [PATCH] Fix`TextEdit` selection when placed in a `Scene`. (#5791) * Closes https://github.com/emilk/egui/issues/5789 * [x] I have followed the instructions in the PR template While this change fixes the TextEdit specific issue, I'm worried that the underlying problem is more fundamental and could show up in other widgets, and I'm wondering if there's a more general solution? --- crates/egui/src/widgets/text_edit/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/text_edit/builder.rs b/crates/egui/src/widgets/text_edit/builder.rs index b3ac4cd8..6350b202 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/crates/egui/src/widgets/text_edit/builder.rs @@ -578,7 +578,7 @@ impl TextEdit<'_> { let painter = ui.painter_at(text_clip_rect.expand(1.0)); // expand to avoid clipping cursor if interactive { - if let Some(pointer_pos) = ui.ctx().pointer_interact_pos() { + if let Some(pointer_pos) = response.interact_pointer_pos() { if response.hovered() && text.is_mutable() { ui.output_mut(|o| o.mutable_text_under_cursor = true); }