diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-05-16 15:27:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-16 15:27:46 +0100 |
commit | 7add8d373185a6b20aeeb8c30adb9acc68de66ec (patch) | |
tree | 0c334ef25ebe071a145db46d90b83485abba636d /src/testing.c | |
parent | 3b675c276c71472022b684b7b1dec213824d3104 (diff) | |
download | vim-git-7add8d373185a6b20aeeb8c30adb9acc68de66ec.tar.gz |
patch 8.2.4965: GUI: testing mouse move event depends on screen cell sizev8.2.4965
Problem: GUI: testing mouse move event depends on screen cell size.
Solution: Multiply the row and column with the screen cell size.
Diffstat (limited to 'src/testing.c')
-rw-r--r-- | src/testing.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testing.c b/src/testing.c index 572dcdcff..23ab98f5c 100644 --- a/src/testing.c +++ b/src/testing.c @@ -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"); |