diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-20 18:52:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-20 19:09:56 +0300 |
commit | 661d363e13ff3c86b30d09333e5334146e5da79f (patch) | |
tree | 9819fb8cf5224f0b8aa76a216217cbfb4f8089db /source/blender/editors/space_image | |
parent | a5f19e3f7270b335d324c4fa5a9ca33e59376ef0 (diff) |
Fix T73162: Modal tools cant be mapped to MMB
Also rename struct members to 'launch_event', since it's more
descriptive and was called this in some places.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 061ed978acd..2ed8b8c87ff 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -305,7 +305,7 @@ static bool image_sample_poll(bContext *C) typedef struct ViewPanData { float x, y; float xof, yof; - int event_type; + int launch_event; bool own_cursor; } ViewPanData; @@ -327,7 +327,7 @@ static void image_view_pan_init(bContext *C, wmOperator *op, const wmEvent *even vpd->y = event->y; vpd->xof = sima->xof; vpd->yof = sima->yof; - vpd->event_type = event->type; + vpd->launch_event = WM_userdef_event_type_from_keymap_type(event->type); WM_event_add_modal_handler(C, op); } @@ -398,7 +398,7 @@ static int image_view_pan_modal(bContext *C, wmOperator *op, const wmEvent *even image_view_pan_exec(C, op); break; default: - if (event->type == vpd->event_type && event->val == KM_RELEASE) { + if (event->type == vpd->launch_event && event->val == KM_RELEASE) { image_view_pan_exit(C, op, false); return OPERATOR_FINISHED; } @@ -452,7 +452,7 @@ void IMAGE_OT_view_pan(wmOperatorType *ot) typedef struct ViewZoomData { float origx, origy; float zoom; - int event_type; + int launch_event; float location[2]; /* needed for continuous zoom */ @@ -483,7 +483,7 @@ static void image_view_zoom_init(bContext *C, wmOperator *op, const wmEvent *eve vpd->origx = event->x; vpd->origy = event->y; vpd->zoom = sima->zoom; - vpd->event_type = event->type; + vpd->launch_event = WM_userdef_event_type_from_keymap_type(event->type); UI_view2d_region_to_view( &ar->v2d, event->mval[0], event->mval[1], &vpd->location[0], &vpd->location[1]); @@ -633,7 +633,7 @@ static int image_view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *eve else if (event->type == MOUSEMOVE) { event_code = VIEW_APPLY; } - else if (event->type == vpd->event_type && event->val == KM_RELEASE) { + else if (event->type == vpd->launch_event && event->val == KM_RELEASE) { event_code = VIEW_CONFIRM; } |