Fix 'WM_window_find_under_cursor'

This function was not working if the window is partially out of screen space.
This commit is contained in:
Germano Cavalcante 2021-08-30 22:45:26 -03:00
parent b08ab49cce
commit 65739ded54
Notes: blender-bot 2023-02-14 08:38:11 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
1 changed files with 1 additions and 1 deletions

View File

@ -1945,7 +1945,7 @@ wmWindow *WM_window_find_under_cursor(const wmWindowManager *wm,
int scr_pos[2];
wm_window_screen_pos_get(win_iter, desk_pos, scr_pos);
if (scr_pos[0] >= 0 && win_iter->posy >= 0 && scr_pos[0] <= WM_window_pixels_x(win_iter) &&
if (scr_pos[0] >= 0 && scr_pos[1] >= 0 && scr_pos[0] <= WM_window_pixels_x(win_iter) &&
scr_pos[1] <= WM_window_pixels_y(win_iter)) {
copy_v2_v2_int(r_mval, scr_pos);