Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-16 09:23:24 +0300
committerCampbell Barton <campbell@blender.org>2022-06-16 09:32:35 +0300
commit1064bf58c3e8fd28d55a09632046a3c008ca1f03 (patch)
tree686baeec3ad4380f9e825713b968d92d3553ee7f /source/blender/windowmanager/intern/wm_event_system.cc
parentb19751bee21c6ba46b46e1286bfed56e52bfc1d2 (diff)
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.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.cc')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.cc10
1 files changed, 5 insertions, 5 deletions
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;
}
}