From d33944197f835000927e7f5397fc7c8d1adc59b0 Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Tue, 12 Nov 2024 23:41:20 -0500 Subject: [PATCH] improve mouse position calculation --- tui/src/state.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index e2203d0a..4ecc2c95 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -505,7 +505,8 @@ impl AppState { if mouse_in_list { self.focus = Focus::List; 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(); if relative_y < list_len as u16 { self.selection.select(Some(relative_y as usize));