diff options
author | Yevgeny Makarov <jenkm> | 2019-09-04 15:46:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-04 15:51:48 +0300 |
commit | 0381727663ec405916565f0f5f677bdb7e6ac510 (patch) | |
tree | 44f7eb92a50fd0bf5653a54e3adfefd69fe08cc5 /source/blender/windowmanager/intern/wm_operator_props.c | |
parent | 4d995527a9a13053ae910c5aad661b00e6a9498b (diff) |
Fix T55745: Checker de-select, inconsistent selection
With these changes, successive selections result in an even pattern.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operator_props.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operator_props.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index 34e17a8102a..de82c3942db 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -500,19 +500,26 @@ void WM_operator_properties_mouse_select(wmOperatorType *ot) */ void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_disable) { - const int nth_default = nth_can_disable ? 1 : 2; - const int nth_min = min_ii(nth_default, 2); + const int nth_default = nth_can_disable ? 0 : 1; + const int nth_min = min_ii(nth_default, 1); RNA_def_int(ot->srna, - "nth", + "skip", nth_default, nth_min, INT_MAX, - "Nth Element", - "Skip every Nth element", + "Deselected", + "Number of deselected elements in the repetitive sequence", nth_min, 100); - RNA_def_int( - ot->srna, "skip", 1, 1, INT_MAX, "Skip", "Number of elements to skip at once", 1, 100); + RNA_def_int(ot->srna, + "nth", + 1, + 1, + INT_MAX, + "Selected", + "Number of selected elements in the repetitive sequence", + 1, + 100); RNA_def_int(ot->srna, "offset", 0, @@ -527,7 +534,7 @@ void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_di void WM_operator_properties_checker_interval_from_op(struct wmOperator *op, struct CheckerIntervalParams *op_params) { - const int nth = RNA_int_get(op->ptr, "nth") - 1; + const int nth = RNA_int_get(op->ptr, "nth"); const int skip = RNA_int_get(op->ptr, "skip"); int offset = RNA_int_get(op->ptr, "offset"); @@ -541,6 +548,6 @@ void WM_operator_properties_checker_interval_from_op(struct wmOperator *op, bool WM_operator_properties_checker_interval_test(const struct CheckerIntervalParams *op_params, int depth) { - return ((op_params->nth == 0) || + return ((op_params->skip == 0) || ((op_params->offset + depth) % (op_params->skip + op_params->nth) >= op_params->skip)); } |