Fix crash and wrong columnar selection when mousing over block lines

This commit is contained in:
Max Brunsfeld 2022-08-03 10:19:06 -07:00
parent e1431ede36
commit 096f4693d3
3 changed files with 46 additions and 40 deletions

View file

@ -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