input: Fix mouse click to position cursor to before of the char. (#572)
This commit is contained in:
parent
77badb5799
commit
1dba2b6c70
1 changed files with 3 additions and 3 deletions
|
|
@ -776,9 +776,9 @@ impl TextInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.modifiers.shift {
|
if event.modifiers.shift {
|
||||||
self.select_to(self.next_boundary(offset), cx);
|
self.select_to(self.previous_boundary(offset), cx);
|
||||||
} else {
|
} else {
|
||||||
self.move_to(self.next_boundary(offset), cx)
|
self.move_to(self.previous_boundary(offset), cx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1168,7 +1168,7 @@ impl TextInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
let offset = self.index_for_mouse_position(event.position, cx);
|
let offset = self.index_for_mouse_position(event.position, cx);
|
||||||
self.select_to(self.next_boundary(offset), cx);
|
self.select_to(self.previous_boundary(offset), cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_valid_input(&self, new_text: &str) -> bool {
|
fn is_valid_input(&self, new_text: &str) -> bool {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue