mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 23:13:13 -04:00
TextEdit: only show cursor preview when moving mouse
This commit is contained in:
@@ -506,6 +506,10 @@ impl MouseInput {
|
||||
pos_history: self.pos_history,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_moving(&self) -> bool {
|
||||
self.velocity != Vec2::zero()
|
||||
}
|
||||
}
|
||||
|
||||
impl RawInput {
|
||||
|
||||
@@ -324,7 +324,7 @@ impl<'t> TextEdit<'t> {
|
||||
|
||||
let cursor_at_mouse = galley.cursor_from_pos(mouse_pos - response.rect.min);
|
||||
|
||||
if response.hovered {
|
||||
if response.hovered && ui.input().mouse.is_moving() {
|
||||
// preview:
|
||||
paint_cursor_end(ui, response.rect.min, &galley, &cursor_at_mouse);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user