Tool System: use set/add/subtract for all circle select operators

This applies changes from the 3D view circle select to other operators.
This commit is contained in:
2019-03-05 22:26:45 +11:00
parent 0ae6747300
commit 8d8d113b73
15 changed files with 100 additions and 54 deletions

View File

@@ -375,9 +375,7 @@ void WM_operator_properties_gesture_lasso_ex(struct wmOperatorType *ot, b
void WM_operator_properties_gesture_lasso(struct wmOperatorType *ot);
void WM_operator_properties_gesture_lasso_select(struct wmOperatorType *ot);
void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor);
void WM_operator_properties_gesture_circle_ex(struct wmOperatorType *ot, bool deselect);
void WM_operator_properties_gesture_circle(struct wmOperatorType *ot);
void WM_operator_properties_gesture_circle_select(struct wmOperatorType *ot);
void WM_operator_properties_mouse_select(struct wmOperatorType *ot);
void WM_operator_properties_select_all(struct wmOperatorType *ot);
void WM_operator_properties_select_action(struct wmOperatorType *ot, int default_action);
@@ -483,6 +481,7 @@ void WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op);
struct wmGesture *WM_gesture_new(struct bContext *C, const struct wmEvent *event, int type);
void WM_gesture_end(struct bContext *C, struct wmGesture *gesture);
void WM_gestures_remove(struct bContext *C);
bool WM_gesture_is_modal_first(const struct wmGesture *gesture);
/* fileselecting support */
void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op);

View File

@@ -116,6 +116,13 @@ void WM_gestures_remove(bContext *C)
WM_gesture_end(C, win->gesture.first);
}
bool WM_gesture_is_modal_first(const wmGesture *gesture)
{
if (gesture == NULL) {
return true;
}
return (gesture->is_active_prev == false);
}
/* tweak and line gestures */
int wm_gesture_evaluate(wmGesture *gesture)

View File

@@ -353,7 +353,7 @@ void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
/**
* Use with #WM_gesture_circle_invoke
*/
void WM_operator_properties_gesture_circle_ex(wmOperatorType *ot, bool deselect)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
{
PropertyRNA *prop;
const int radius_default = 25;
@@ -366,21 +366,6 @@ void WM_operator_properties_gesture_circle_ex(wmOperatorType *ot, bool deselect)
prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
if (deselect) {
prop = RNA_def_boolean(ot->srna, "deselect", false, "Deselect", "Deselect rather than select items");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
}
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
{
WM_operator_properties_gesture_circle_ex(ot, false);
}
void WM_operator_properties_gesture_circle_select(wmOperatorType *ot)
{
WM_operator_properties_gesture_circle_ex(ot, true);
}
void WM_operator_properties_mouse_select(wmOperatorType *ot)