diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2021-10-20 15:45:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-20 16:00:01 +0300 |
commit | 2743d746ea4f38c098512f6dd6fc33d5a62429d3 (patch) | |
tree | 0680f3c4713b7ecd698b91c5d1298734fc55f7ff /source/blender/windowmanager/intern/wm_gesture.c | |
parent | 3435ea014d42d1e223513f448cbdaba63864115c (diff) |
Cleanup: use an array for wmEvent cursor position variables
Use arrays for wmEvent coordinates, this quiets warnings with GCC11.
- `x, y` -> `xy`.
- `prevx, prevy` -> `prev_xy`.
- `prevclickx, prevclicky` -> `prev_click_xy`.
There is still some cleanup such as using `copy_v2_v2_int()`,
this can be done separately.
Reviewed By: campbellbarton, Severin
Ref D12901
Diffstat (limited to 'source/blender/windowmanager/intern/wm_gesture.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index ae2cdb5608c..ab971901a20 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -73,14 +73,14 @@ wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent rcti *rect = MEM_callocN(sizeof(rcti), "gesture rect new"); gesture->customdata = rect; - rect->xmin = event->x - gesture->winrct.xmin; - rect->ymin = event->y - gesture->winrct.ymin; + rect->xmin = event->xy[0] - gesture->winrct.xmin; + rect->ymin = event->xy[1] - gesture->winrct.ymin; if (type == WM_GESTURE_CIRCLE) { /* caller is responsible for initializing 'xmax' to radius. */ } else { - rect->xmax = event->x - gesture->winrct.xmin; - rect->ymax = event->y - gesture->winrct.ymin; + rect->xmax = event->xy[0] - gesture->winrct.xmin; + rect->ymax = event->xy[1] - gesture->winrct.ymin; } } else if (ELEM(type, WM_GESTURE_LINES, WM_GESTURE_LASSO)) { @@ -88,8 +88,8 @@ wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent gesture->points_alloc = 1024; gesture->customdata = lasso = MEM_mallocN(sizeof(short[2]) * gesture->points_alloc, "lasso points"); - lasso[0] = event->x - gesture->winrct.xmin; - lasso[1] = event->y - gesture->winrct.ymin; + lasso[0] = event->xy[0] - gesture->winrct.xmin; + lasso[1] = event->xy[1] - gesture->winrct.ymin; gesture->points = 1; } |