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:
authorCampbell Barton <ideasman42@gmail.com>2020-01-20 18:52:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-20 19:09:56 +0300
commit661d363e13ff3c86b30d09333e5334146e5da79f (patch)
tree9819fb8cf5224f0b8aa76a216217cbfb4f8089db /source/blender/editors/sculpt_paint
parenta5f19e3f7270b335d324c4fa5a9ca33e59376ef0 (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/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c6
2 files changed, 6 insertions, 6 deletions
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;
}
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 6252741799a..7863e18394c 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -562,7 +562,7 @@ typedef struct {
float *dim_target;
float *rot_target;
float *pos_target;
- short event_type;
+ short launch_event;
} StencilControlData;
static void stencil_set_target(StencilControlData *scd)
@@ -626,7 +626,7 @@ static int stencil_control_invoke(bContext *C, wmOperator *op, const wmEvent *ev
stencil_set_target(scd);
scd->mode = RNA_enum_get(op->ptr, "mode");
- scd->event_type = event->type;
+ scd->launch_event = WM_userdef_event_type_from_keymap_type(event->type);
scd->area_size[0] = ar->winx;
scd->area_size[1] = ar->winy;
@@ -709,7 +709,7 @@ static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *eve
{
StencilControlData *scd = op->customdata;
- if (event->type == scd->event_type && event->val == KM_RELEASE) {
+ if (event->type == scd->launch_event && event->val == KM_RELEASE) {
MEM_freeN(op->customdata);
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_FINISHED;