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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-10-20 15:45:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-10-20 16:00:01 +0300
commit2743d746ea4f38c098512f6dd6fc33d5a62429d3 (patch)
tree0680f3c4713b7ecd698b91c5d1298734fc55f7ff /source/blender/editors/gpencil
parent3435ea014d42d1e223513f448cbdaba63864115c (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/gpencil')
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 8924865f5e1..ba603cdd6ec 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2560,7 +2560,7 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve
if ((p->region) && (p->region->regiontype == RGN_TYPE_TOOLS)) {
/* Change to whatever region is now under the mouse */
ARegion *current_region = BKE_area_find_region_xy(
- p->area, RGN_TYPE_ANY, event->x, event->y);
+ p->area, RGN_TYPE_ANY, event->xy[0], event->xy[1]);
if (current_region) {
/* Assume that since we found the cursor in here, it is in bounds
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index f5474a7cdc3..52487e07f53 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -2103,11 +2103,11 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* first time the event is not enabled to show help lines. */
if ((tgpf->oldkey != -1) || (!help_lines)) {
ARegion *region = BKE_area_find_region_xy(
- CTX_wm_area(C), RGN_TYPE_ANY, event->x, event->y);
+ CTX_wm_area(C), RGN_TYPE_ANY, event->xy[0], event->xy[1]);
if (region) {
bool in_bounds = false;
/* Perform bounds check */
- in_bounds = BLI_rcti_isect_pt(&region->winrct, event->x, event->y);
+ in_bounds = BLI_rcti_isect_pt(&region->winrct, event->xy[0], event->xy[1]);
if ((in_bounds) && (region->regiontype == RGN_TYPE_WINDOW)) {
tgpf->mouse[0] = event->mval[0];
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index d7cab85abad..22127d7ac3b 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -586,7 +586,7 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
static void gpencil_mouse_update_shift(tGPDinterpolate *tgpi, wmOperator *op, const wmEvent *event)
{
float mid = (float)(tgpi->region->winx - tgpi->region->winrct.xmin) / 2.0f;
- float mpos = event->x - tgpi->region->winrct.xmin;
+ float mpos = event->xy[0] - tgpi->region->winrct.xmin;
if (mpos >= mid) {
tgpi->shift = ((mpos - mid) * tgpi->high_limit) / mid;
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 2aa4b3b3282..070470b3734 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3666,7 +3666,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
if ((p->region) && (p->region->regiontype == RGN_TYPE_TOOLS)) {
/* Change to whatever region is now under the mouse */
ARegion *current_region = BKE_area_find_region_xy(
- p->area, RGN_TYPE_ANY, event->x, event->y);
+ p->area, RGN_TYPE_ANY, event->xy[0], event->xy[1]);
if (current_region) {
/* Assume that since we found the cursor in here, it is in bounds