mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-21 12:59:41 +00:00
improve mouse position calculation
This commit is contained in:
parent
55fed66f0b
commit
961511fb72
|
@ -505,7 +505,8 @@ impl AppState {
|
||||||
if mouse_in_list {
|
if mouse_in_list {
|
||||||
self.focus = Focus::List;
|
self.focus = Focus::List;
|
||||||
if let Some(areas) = &self.areas {
|
if let Some(areas) = &self.areas {
|
||||||
let relative_y = position.y.saturating_sub(areas.list.y + 1);
|
let list_start = areas.list.y + 4;
|
||||||
|
let relative_y = position.y.saturating_sub(list_start);
|
||||||
let list_len = self.filter.item_list().len();
|
let list_len = self.filter.item_list().len();
|
||||||
if relative_y < list_len as u16 {
|
if relative_y < list_len as u16 {
|
||||||
self.selection.select(Some(relative_y as usize));
|
self.selection.select(Some(relative_y as usize));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user