From 661d363e13ff3c86b30d09333e5334146e5da79f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Jan 2020 02:52:20 +1100 Subject: 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. --- source/blender/editors/sculpt_paint/paint_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_image.c') diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index de09a52258f..6d1a32d1c45 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -939,7 +939,7 @@ void PAINT_OT_grab_clone(wmOperatorType *ot) /******************** sample color operator ********************/ typedef struct { bool show_cursor; - short event_type; + short launch_event; float initcolor[3]; bool sample_palette; } SampleColorData; @@ -1000,7 +1000,7 @@ static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event ARegion *ar = CTX_wm_region(C); wmWindow *win = CTX_wm_window(C); - data->event_type = event->type; + data->launch_event = WM_userdef_event_type_from_keymap_type(event->type); data->show_cursor = ((paint->flags & PAINT_SHOW_BRUSH) != 0); copy_v3_v3(data->initcolor, BKE_brush_color_get(scene, brush)); data->sample_palette = false; @@ -1036,7 +1036,7 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = BKE_paint_brush(paint); - if ((event->type == data->event_type) && (event->val == KM_RELEASE)) { + if ((event->type == data->launch_event) && (event->val == KM_RELEASE)) { if (data->show_cursor) { paint->flags |= PAINT_SHOW_BRUSH; } -- cgit v1.2.3