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:
authorBastien Montagne <montagne29@wanadoo.fr>2012-07-14 18:03:36 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-07-14 18:03:36 +0400
commit01c3db149cfcd5cb357d8fc739bbe4beb08b35e7 (patch)
tree40bfc9e2e6a8809ee6e70c526ed32c6ecf6b9e6a /source/blender/editors/util/numinput.c
parent98520ce4deccb24e5992930694bb4189f6fce0f3 (diff)
Fix [#32086] Missing bevel "hold shift" for better accuracy.
This commit adds "shift" and numtype to both Bevel and Inset mesh operators. It also gets rid of the magicnumber used in NumInput to str operation (currently, 20 chars per element, now defined as NUM_STR_REP_LEN in ED_numinput.h).
Diffstat (limited to 'source/blender/editors/util/numinput.c')
-rw-r--r--source/blender/editors/util/numinput.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 91290829662..281b682465d 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -66,6 +66,7 @@ void outputNumInput(NumInput *n, char *str)
char cur;
char inv[] = "1/";
short i, j;
+ const int ln = NUM_STR_REP_LEN;
for (j = 0; j <= n->idx_max; j++) {
/* if AFFECTALL and no number typed and cursor not on number, use first number */
@@ -85,34 +86,34 @@ void outputNumInput(NumInput *n, char *str)
inv[0] = 0;
if (n->val[i] > 1e10f || n->val[i] < -1e10f)
- BLI_snprintf(&str[j * 20], 20, "%s%.4e%c", inv, n->val[i], cur);
+ BLI_snprintf(&str[j * ln], ln, "%s%.4e%c", inv, n->val[i], cur);
else
switch (n->ctrl[i]) {
case 0:
- BLI_snprintf(&str[j * 20], 20, "%sNONE%c", inv, cur);
+ BLI_snprintf(&str[j * ln], ln, "%sNONE%c", inv, cur);
break;
case 1:
case -1:
- BLI_snprintf(&str[j * 20], 20, "%s%.0f%c", inv, n->val[i], cur);
+ BLI_snprintf(&str[j * ln], ln, "%s%.0f%c", inv, n->val[i], cur);
break;
case 10:
case -10:
- BLI_snprintf(&str[j * 20], 20, "%s%.f.%c", inv, n->val[i], cur);
+ BLI_snprintf(&str[j * ln], ln, "%s%.f.%c", inv, n->val[i], cur);
break;
case 100:
case -100:
- BLI_snprintf(&str[j * 20], 20, "%s%.1f%c", inv, n->val[i], cur);
+ BLI_snprintf(&str[j * ln], ln, "%s%.1f%c", inv, n->val[i], cur);
break;
case 1000:
case -1000:
- BLI_snprintf(&str[j * 20], 20, "%s%.2f%c", inv, n->val[i], cur);
+ BLI_snprintf(&str[j * ln], ln, "%s%.2f%c", inv, n->val[i], cur);
break;
case 10000:
case -10000:
- BLI_snprintf(&str[j * 20], 20, "%s%.3f%c", inv, n->val[i], cur);
+ BLI_snprintf(&str[j * ln], ln, "%s%.3f%c", inv, n->val[i], cur);
break;
default:
- BLI_snprintf(&str[j * 20], 20, "%s%.4e%c", inv, n->val[i], cur);
+ BLI_snprintf(&str[j * ln], ln, "%s%.4e%c", inv, n->val[i], cur);
}
}
}