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/editors/gizmo_library | |
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/editors/gizmo_library')
-rw-r--r-- | source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c index 6345cd3525a..d4d4c889209 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c @@ -307,7 +307,7 @@ static void dial_ghostarc_get_angles(const wmGizmo *gz, { DialInteraction *inter = gz->interaction_data; const RegionView3D *rv3d = region->regiondata; - const float mval[2] = {event->x - region->winrct.xmin, event->y - region->winrct.ymin}; + const float mval[2] = {event->xy[0] - region->winrct.xmin, event->xy[1] - region->winrct.ymin}; /* We might need to invert the direction of the angles. */ float view_vec[3], axis_vec[3]; diff --git a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c index 13d9f1ecda7..33532bd0549 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c @@ -120,8 +120,8 @@ void ED_gizmotypes_snap_3d_data_get(const struct bContext *C, const wmEvent *event = wm->winactive ? wm->winactive->eventstate : NULL; if (event) { ARegion *region = CTX_wm_region(C); - int x = event->x - region->winrct.xmin; - int y = event->y - region->winrct.ymin; + int x = event->xy[0] - region->winrct.xmin; + int y = event->xy[1] - region->winrct.ymin; snap_data = ED_view3d_cursor_snap_data_get(NULL, C, x, y); } } @@ -250,8 +250,8 @@ static int snap_gizmo_test_select(bContext *C, wmGizmo *gz, const int mval[2]) const wmEvent *event = wm->winactive ? wm->winactive->eventstate : NULL; if (event) { ARegion *region = CTX_wm_region(C); - x = event->x - region->winrct.xmin; - y = event->y - region->winrct.ymin; + x = event->xy[0] - region->winrct.xmin; + y = event->xy[1] - region->winrct.ymin; } else { x = mval[0]; |