From daae4ce652c3ea88944f8c2ada7eb98a8380e99e Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 7 Apr 2026 12:59:46 +0200 Subject: [PATCH] Fix wrong color of last glyph of selected text (#8075) * Closes https://github.com/emilk/egui/issues/8059 --- crates/egui/src/text_selection/visuals.rs | 2 +- crates/egui_demo_lib/tests/snapshots/text_selection_0.png | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/egui/src/text_selection/visuals.rs b/crates/egui/src/text_selection/visuals.rs index e41d7a436..e114ddb55 100644 --- a/crates/egui/src/text_selection/visuals.rs +++ b/crates/egui/src/text_selection/visuals.rs @@ -61,7 +61,7 @@ pub fn paint_text_selection( let last_glyph_index = if ri == max.row { max.column } else { - row.glyphs.len() - 1 + row.glyphs.len() }; let first_vertex_index = row diff --git a/crates/egui_demo_lib/tests/snapshots/text_selection_0.png b/crates/egui_demo_lib/tests/snapshots/text_selection_0.png index 7930dff48..a7aac34bf 100644 --- a/crates/egui_demo_lib/tests/snapshots/text_selection_0.png +++ b/crates/egui_demo_lib/tests/snapshots/text_selection_0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:344d90928510855dc718a2e36e31a97f084f1163ab750d0217fb8620469b621a -size 5276 +oid sha256:ce1e16fa09588ec5351d031408657137f42ff40eb7cf6dd00b8c65a4f51ec680 +size 5332