mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Fix text selection crashes
Closes https://github.com/emilk/egui/issues/3881
This commit is contained in:
@@ -834,10 +834,9 @@ impl Galley {
|
|||||||
|
|
||||||
pub fn end_rcursor(&self) -> RCursor {
|
pub fn end_rcursor(&self) -> RCursor {
|
||||||
if let Some(last_row) = self.rows.last() {
|
if let Some(last_row) = self.rows.last() {
|
||||||
crate::epaint_assert!(!last_row.ends_with_newline);
|
|
||||||
RCursor {
|
RCursor {
|
||||||
row: self.rows.len() - 1,
|
row: self.rows.len() - 1,
|
||||||
column: last_row.char_count_excluding_newline(),
|
column: last_row.char_count_including_newline(),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Default::default()
|
Default::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user