From 5608b747fd29ebefb7f9fdabe4f666378e170bd6 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Sun, 28 Jun 2026 16:05:54 +0900 Subject: [PATCH 1/2] Update cursor rectangle for IME output --- crates/egui/src/widgets/text_edit/builder.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/text_edit/builder.rs b/crates/egui/src/widgets/text_edit/builder.rs index ccc3a56c845..6834c26d59f 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/crates/egui/src/widgets/text_edit/builder.rs @@ -906,9 +906,11 @@ impl TextEdit<'_> { .layer_transform_to_global(ui.layer_id()) .unwrap_or_default(); ui.output_mut(|o| { + let tiny_rect = + Rect::from_min_size(primary_cursor_rect.left_top(), Vec2::ZERO); o.ime = Some(crate::output::IMEOutput { rect: to_global * inner_rect, - cursor_rect: to_global * primary_cursor_rect, + cursor_rect: to_global * tiny_rect, should_interrupt_composition: false, }); }); From 64a65324cc75673a95ded0e8f823abc69ca48084 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Fri, 7 Aug 2026 21:18:56 +0900 Subject: [PATCH 2/2] Fix cursor rectangle calculation in text edit builder Changed from `left_top()` to `left_bottom()` to change the scroll reference point. --- 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 57f5b779759..15aaa848592 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/crates/egui/src/widgets/text_edit/builder.rs @@ -933,7 +933,7 @@ impl TextEdit<'_> { .unwrap_or_default(); ui.output_mut(|o| { let tiny_rect = - Rect::from_min_size(primary_cursor_rect.left_top(), Vec2::ZERO); + Rect::from_min_size(primary_cursor_rect.left_bottom(), Vec2::ZERO); o.ime = Some(crate::output::IMEOutput { purpose: if password { IMEPurpose::Password