From 5e7fa4645103be1f73db19ef313a93cae7ab4921 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 24 Jan 2024 15:47:44 +0100 Subject: [PATCH] Fix text selection crashes Closes https://github.com/emilk/egui/issues/3881 --- crates/epaint/src/text/text_layout_types.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/epaint/src/text/text_layout_types.rs b/crates/epaint/src/text/text_layout_types.rs index b6fab06b..70317f77 100644 --- a/crates/epaint/src/text/text_layout_types.rs +++ b/crates/epaint/src/text/text_layout_types.rs @@ -834,10 +834,9 @@ impl Galley { pub fn end_rcursor(&self) -> RCursor { if let Some(last_row) = self.rows.last() { - crate::epaint_assert!(!last_row.ends_with_newline); RCursor { row: self.rows.len() - 1, - column: last_row.char_count_excluding_newline(), + column: last_row.char_count_including_newline(), } } else { Default::default()