diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_query.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_query.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c index c9f83a5d811..9a7d31f8bb8 100644 --- a/source/blender/windowmanager/intern/wm_event_query.c +++ b/source/blender/windowmanager/intern/wm_event_query.c @@ -227,8 +227,8 @@ bool WM_event_is_mouse_drag_or_press(const wmEvent *event) int WM_event_drag_direction(const wmEvent *event) { const int delta[2] = { - event->xy[0] - event->prev_click_xy[0], - event->xy[1] - event->prev_click_xy[1], + event->xy[0] - event->prev_press_xy[0], + event->xy[1] - event->prev_press_xy[1], }; int theta = round_fl_to_int(4.0f * atan2f((float)delta[1], (float)delta[0]) / (float)M_PI); @@ -306,8 +306,8 @@ bool WM_cursor_test_motion_and_update(const int mval[2]) int WM_event_drag_threshold(const struct wmEvent *event) { int drag_threshold; - if (ISMOUSE(event->prev_click_type)) { - BLI_assert(event->prev_click_type != MOUSEMOVE); + if (ISMOUSE(event->prev_press_type)) { + BLI_assert(event->prev_press_type != MOUSEMOVE); /* Using the previous type is important is we want to check the last pressed/released button, * The `event->type` would include #MOUSEMOVE which is always the case when dragging * and does not help us know which threshold to use. */ @@ -340,21 +340,21 @@ bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2]) void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2]) { - const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_click_xy : event->xy; + const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy; r_mval[0] = xy[0] - region->winrct.xmin; r_mval[1] = xy[1] - region->winrct.ymin; } void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2]) { - const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_click_xy : event->xy; + const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy; r_mval[0] = xy[0] - region->winrct.xmin; r_mval[1] = xy[1] - region->winrct.ymin; } void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2]) { - copy_v2_v2_int(r_xy, (event->val == KM_CLICK_DRAG) ? event->prev_click_xy : event->xy); + copy_v2_v2_int(r_xy, (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy); } /** \} */ |