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/util
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/util')
-rw-r--r--source/blender/editors/util/ed_draw.c14
-rw-r--r--source/blender/editors/util/ed_util_imbuf.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/util/ed_draw.c b/source/blender/editors/util/ed_draw.c
index fc351ab728c..97540068c30 100644
--- a/source/blender/editors/util/ed_draw.c
+++ b/source/blender/editors/util/ed_draw.c
@@ -356,12 +356,12 @@ static void slider_draw(const struct bContext *UNUSED(C), ARegion *region, void
static void slider_update_factor(tSlider *slider, const wmEvent *event)
{
- const float factor_delta = (event->x - slider->last_cursor[0]) / SLIDE_PIXEL_DISTANCE;
+ const float factor_delta = (event->xy[0] - slider->last_cursor[0]) / SLIDE_PIXEL_DISTANCE;
/* Reduced factor delta in precision mode (shift held). */
slider->raw_factor += slider->precision ? (factor_delta / 8) : factor_delta;
slider->factor = slider->raw_factor;
- slider->last_cursor[0] = event->x;
- slider->last_cursor[1] = event->y;
+ slider->last_cursor[0] = event->xy[0];
+ slider->last_cursor[1] = event->xy[1];
if (!slider->overshoot) {
slider->factor = clamp_f(slider->factor, 0, 1);
@@ -403,8 +403,8 @@ tSlider *ED_slider_create(struct bContext *C)
*/
void ED_slider_init(struct tSlider *slider, const wmEvent *event)
{
- slider->last_cursor[0] = event->x;
- slider->last_cursor[1] = event->y;
+ slider->last_cursor[0] = event->xy[0];
+ slider->last_cursor[1] = event->xy[1];
}
/**
@@ -533,8 +533,8 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_
wmWindow *win = CTX_wm_window(C);
const float *mval_src = (float *)arg_info;
const float mval_dst[2] = {
- win->eventstate->x - region->winrct.xmin,
- win->eventstate->y - region->winrct.ymin,
+ win->eventstate->xy[0] - region->winrct.xmin,
+ win->eventstate->xy[1] - region->winrct.ymin,
};
const uint shdr_pos = GPU_vertformat_attr_add(
diff --git a/source/blender/editors/util/ed_util_imbuf.c b/source/blender/editors/util/ed_util_imbuf.c
index 7f1a53cc1e8..38ae98c678f 100644
--- a/source/blender/editors/util/ed_util_imbuf.c
+++ b/source/blender/editors/util/ed_util_imbuf.c
@@ -451,7 +451,7 @@ void ED_imbuf_sample_draw(const bContext *C, ARegion *region, void *arg_info)
rctf sample_rect_fl;
BLI_rctf_init_pt_radius(
&sample_rect_fl,
- (float[2]){event->x - region->winrct.xmin, event->y - region->winrct.ymin},
+ (float[2]){event->xy[0] - region->winrct.xmin, event->xy[1] - region->winrct.ymin},
(float)(info->sample_size / 2.0f) * sima->zoom);
GPU_logic_op_xor_set(true);