0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4965: GUI: testing mouse move event depends on screen cell size

Problem:    GUI: testing mouse move event depends on screen cell size.
Solution:   Multiply the row and column with the screen cell size.
This commit is contained in:
Bram Moolenaar
2022-05-16 15:27:46 +01:00
parent 3b675c276c
commit 7add8d3731
4 changed files with 38 additions and 20 deletions

View File

@@ -1386,7 +1386,15 @@ test_gui_mouse_event(dict_T *args)
col = (int)dict_get_number(args, (char_u *)"col");
if (move)
{
if (dict_get_bool(args, (char_u *)"cell", FALSE))
{
// click in the middle of the character cell
row = row * gui.char_height + gui.char_height / 2;
col = col * gui.char_width + gui.char_width / 2;
}
gui_mouse_moved(col, row);
}
else
{
button = (int)dict_get_number(args, (char_u *)"button");