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/editors/mesh/editmesh_loopcut.c9
-rw-r--r--source/blender/editors/util/numinput.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 0b65cce20d7..7298153791e 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -492,7 +492,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
if (event->val == KM_RELEASE)
break;
- cuts = MAX2(cuts - 1, 1);
+ cuts = MAX2(cuts - 1, 0);
RNA_int_set(op->ptr, "number_cuts", cuts);
ringsel_find_edge(lcd, cuts);
show_cuts = TRUE;
@@ -519,12 +519,15 @@ static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event)
/* using the keyboard to input the number of cuts */
if (event->val == KM_PRESS) {
- float value;
+ /* init as zero so backspace clears */
+ float value = 0.0f;
if (handleNumInput(&lcd->num, event)) {
applyNumInput(&lcd->num, &value);
- cuts = CLAMPIS(value, 1, 130);
+ /* allow zero so you can backspace and type in a value
+ * otherwise 1 as minimum would make more sense */
+ cuts = CLAMPIS(value, 0, 130);
RNA_int_set(op->ptr, "number_cuts", cuts);
ringsel_find_edge(lcd, cuts);
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 1f1d5a0c0c0..91290829662 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -221,7 +221,7 @@ char handleNumInput(NumInput *n, wmEvent *event)
break;
case MINUSKEY:
if (n->flag & NUM_NO_NEGATIVE)
- break;
+ return 0;
if (n->ctrl[idx]) {
n->ctrl[idx] *= -1;