From 1064bf58c3e8fd28d55a09632046a3c008ca1f03 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 16 Jun 2022 16:23:24 +1000 Subject: Cleanup: differentiate region/screen relative coordinates - Avoid ambiguity which caused these values to be confused, use `mval` for region relative mouse coordinates, otherwise `event_xy`. - Pass region relative coordinates to sample_detail_dyntopo & sample_detail_voxel as there is no reason to use screen-space values. - Rename invalid use of mval for screen-space coordinates. --- source/blender/windowmanager/intern/wm_event_system.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/windowmanager/intern/wm_event_system.cc') diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index e44016948fc..d3ae4177e4d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -4955,9 +4955,9 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi /* In order to use window size and mouse position (pixels), we have to use a WM function. */ /* Check if outside, include top window bar. */ - int mval[2] = {event->xy[0], event->xy[1]}; - if (mval[0] < 0 || mval[1] < 0 || mval[0] > WM_window_pixels_x(win) || - mval[1] > WM_window_pixels_y(win) + 30) { + int event_xy[2] = {UNPACK2(event->xy)}; + if (event_xy[0] < 0 || event_xy[1] < 0 || event_xy[0] > WM_window_pixels_x(win) || + event_xy[1] > WM_window_pixels_y(win) + 30) { /* Let's skip windows having modal handlers now. */ /* Potential XXX ugly... I wouldn't have added a `modalhandlers` list * (introduced in rev 23331, ton). */ @@ -4967,9 +4967,9 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi } } - wmWindow *win_other = WM_window_find_under_cursor(win, mval, mval); + wmWindow *win_other = WM_window_find_under_cursor(win, event_xy, event_xy); if (win_other && win_other != win) { - copy_v2_v2_int(event->xy, mval); + copy_v2_v2_int(event->xy, event_xy); return win_other; } } -- cgit v1.2.3