From 1fe6d543a5f45ddd7d49a0237bfe32e35e86ce5e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 17 Dec 2012 15:02:26 +0000 Subject: fix/workaround [#33493] checker de-select and edge loops Checker de-select by default would give uneven selection on a circle, this isnt really a bug but the offset used would give unevenly spaced selection even if the 3rd vertex for eg could be evenly selected on a circle. Change how the offset works so the active element always remains selected when the offset is set to zero, this tends to give more even de-selection. --- source/blender/editors/mesh/editmesh_select.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index a8f6ccc6c2c..6ca7777f8e2 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -2630,7 +2630,8 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op) int nth = RNA_int_get(op->ptr, "nth"); int offset = RNA_int_get(op->ptr, "offset"); - offset = MIN2(nth, offset); + /* so input of offset zero ends up being (nth - 1) */ + offset = (offset + (nth - 1)) % nth; if (edbm_deselect_nth(em, nth, offset) == 0) { BKE_report(op->reports, RPT_ERROR, "Mesh has no active vert/edge/face"); -- cgit v1.2.3