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:
-rw-r--r--source/blender/windowmanager/WM_types.h2
-rw-r--r--source/blender/windowmanager/intern/wm_gesture_ops.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index dd4fe95db3b..7d1e13bb1e4 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -427,6 +427,8 @@ typedef struct wmGesture {
/* For modal operators which may be running idle, waiting for an event to activate the gesture.
* Typically this is set when the user is click-dragging the gesture (border and circle select for eg). */
uint is_active : 1;
+ /* Previous value of is-active (use to detect first run & edge cases). */
+ uint is_active_prev : 1;
/* Use for gestures that support both immediate or delayed activation. */
uint wait_for_input : 1;
diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c b/source/blender/windowmanager/intern/wm_gesture_ops.c
index db63eccfd41..030cf15adfb 100644
--- a/source/blender/windowmanager/intern/wm_gesture_ops.c
+++ b/source/blender/windowmanager/intern/wm_gesture_ops.c
@@ -251,6 +251,7 @@ int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
#endif
+ gesture->is_active_prev = gesture->is_active;
return OPERATOR_RUNNING_MODAL;
}
@@ -383,8 +384,8 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
else {
/* apply first click */
- gesture_circle_apply(C, op);
gesture->is_active = true;
+ gesture_circle_apply(C, op);
wm_gesture_tag_redraw(C);
}
break;
@@ -422,7 +423,7 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
#endif
-
+ gesture->is_active_prev = gesture->is_active;
return OPERATOR_RUNNING_MODAL;
}
@@ -655,6 +656,8 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
gesture_modal_end(C, op);
return OPERATOR_CANCELLED;
}
+
+ gesture->is_active_prev = gesture->is_active;
return OPERATOR_RUNNING_MODAL;
}
@@ -841,6 +844,7 @@ int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *ev
}
}
+ gesture->is_active_prev = gesture->is_active;
return OPERATOR_RUNNING_MODAL;
}