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/animation
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/animation')
-rw-r--r--source/blender/editors/animation/anim_markers.c15
-rw-r--r--source/blender/editors/animation/time_scrub_ui.c2
2 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 0de3f429bc7..e12433f4d4c 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -872,7 +872,7 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *eve
ARegion *region = CTX_wm_region(C);
View2D *v2d = &region->v2d;
ListBase *markers = ED_context_get_markers(C);
- if (!region_position_is_over_marker(v2d, markers, event->x - region->winrct.xmin)) {
+ if (!region_position_is_over_marker(v2d, markers, event->xy[0] - region->winrct.xmin)) {
return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
}
}
@@ -880,8 +880,8 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *eve
if (ed_marker_move_init(C, op)) {
MarkerMove *mm = op->customdata;
- mm->evtx = event->x;
- mm->firstx = event->x;
+ mm->evtx = event->xy[0];
+ mm->firstx = event->xy[0];
mm->event_type = event->type;
/* add temp handler */
@@ -993,11 +993,11 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
dx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask);
- if (event->x != mm->evtx) { /* XXX maybe init for first time */
+ if (event->xy[0] != mm->evtx) { /* XXX maybe init for first time */
float fac;
- mm->evtx = event->x;
- fac = ((float)(event->x - mm->firstx) * dx);
+ mm->evtx = event->xy[0];
+ fac = ((float)(event->xy[0] - mm->firstx) * dx);
apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, FPS, 0.1 * FPS, 0);
@@ -1354,7 +1354,8 @@ static int ed_marker_box_select_invoke(bContext *C, wmOperator *op, const wmEven
View2D *v2d = &region->v2d;
ListBase *markers = ED_context_get_markers(C);
- bool over_marker = region_position_is_over_marker(v2d, markers, event->x - region->winrct.xmin);
+ bool over_marker = region_position_is_over_marker(
+ v2d, markers, event->xy[0] - region->winrct.xmin);
bool tweak = RNA_boolean_get(op->ptr, "tweak");
if (tweak && over_marker) {
diff --git a/source/blender/editors/animation/time_scrub_ui.c b/source/blender/editors/animation/time_scrub_ui.c
index 94366a5e852..f3cfbabd544 100644
--- a/source/blender/editors/animation/time_scrub_ui.c
+++ b/source/blender/editors/animation/time_scrub_ui.c
@@ -208,7 +208,7 @@ bool ED_time_scrub_event_in_region(const ARegion *region, const wmEvent *event)
{
rcti rect = region->winrct;
rect.ymin = rect.ymax - UI_TIME_SCRUB_MARGIN_Y;
- return BLI_rcti_isect_pt(&rect, event->x, event->y);
+ return BLI_rcti_isect_pt(&rect, event->xy[0], event->xy[1]);
}
void ED_time_scrub_channel_search_draw(const bContext *C, ARegion *region, bDopeSheet *dopesheet)