mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
Clamp text cursor positions in the same places where we used to (#7081)
Closes #7077. This fixes the problem shown in #7077 where clearing a `TextEdit` wouldn't reset its cursor position. I've fixed that by adding back the `TextCursorState::range` method, which clamps the selection range to that of the passed `Galley`, and calling it in the same places where it was called before #5785. (/cc @juancampa) * [x] I have followed the instructions in the PR template
This commit is contained in:
@@ -1104,6 +1104,10 @@ impl Galley {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clamp_cursor(&self, cursor: &CCursor) -> CCursor {
|
||||
self.cursor_from_layout(self.layout_from_cursor(*cursor))
|
||||
}
|
||||
|
||||
pub fn cursor_up_one_row(
|
||||
&self,
|
||||
cursor: &CCursor,
|
||||
|
||||
Reference in New Issue
Block a user