TextEdit: only show cursor preview when moving mouse
This commit is contained in:
parent
01bee768d9
commit
03c667149a
2 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue