From 24205f572af9c7d875d5ccdea7118035c4cab708 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 18 Sep 2024 11:14:21 +0200 Subject: [PATCH] Fix text selection of only whitespace (#5123) * Closes https://github.com/emilk/egui/issues/5078 * Closes https://github.com/emilk/egui/pull/5120 --- crates/egui/src/text_selection/visuals.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/egui/src/text_selection/visuals.rs b/crates/egui/src/text_selection/visuals.rs index 3182b2b9e39..d86f9dc56c2 100644 --- a/crates/egui/src/text_selection/visuals.rs +++ b/crates/egui/src/text_selection/visuals.rs @@ -79,6 +79,8 @@ pub fn paint_text_selection( mesh.indices[glyph_index_start..glyph_index_start + 6] .clone_from_slice(&selection_triangles); + row.visuals.mesh_bounds = mesh.calc_bounds(); + if let Some(new_vertex_indices) = &mut new_vertex_indices { new_vertex_indices.push(RowVertexIndices { row: ri,