Fix crash and wrong columnar selection when mousing over block lines
This commit is contained in:
parent
e1431ede36
commit
096f4693d3
3 changed files with 46 additions and 40 deletions
|
@ -238,8 +238,10 @@ impl Line {
|
|||
None
|
||||
}
|
||||
|
||||
// If round_to_closest, find the closest index to the given x position
|
||||
// If !round_to_closest, find the largest index before the given x position
|
||||
pub fn len(&self) -> usize {
|
||||
self.layout.len
|
||||
}
|
||||
|
||||
pub fn index_for_x(&self, x: f32) -> Option<usize> {
|
||||
if x >= self.layout.width {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue