mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-27 03:11:46 +00:00
Fix incorrect row being detected under mouse when pixel scroll is non-zero
This commit is contained in:
parent
391b9c9c80
commit
82d3364e4a
1 changed files with 3 additions and 1 deletions
|
|
@ -291,7 +291,9 @@ cell_for_pos(Window *w, unsigned int *x, unsigned int *y, bool *in_left_half_of_
|
|||
in_left_half = (xval - fxval <= 0.5) ? true : false;
|
||||
}
|
||||
if (mouse_y >= g->bottom) qy = screen->lines - 1;
|
||||
else if (mouse_y >= g->top) qy = (unsigned int)((double)(mouse_y - g->top) / os_window->fonts_data->fcm.cell_height);
|
||||
else if (mouse_y >= g->top) {
|
||||
qy = (unsigned int)((double)(mouse_y - g->top - screen->pixel_scroll_offset_y) / os_window->fonts_data->fcm.cell_height);
|
||||
}
|
||||
if (qx < screen->columns && qy < screen->lines) {
|
||||
*x = qx; *y = qy;
|
||||
*in_left_half_of_cell = in_left_half;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue