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:
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 5a8a84112d5..8b0667a8992 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2584,7 +2584,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
bConstraintTypeInfo *cti = BKE_get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT);
bConstraintOb cob;
bConstraint *con;
- int do_limit = false;
+ bool do_limit = false;
/* Evaluate valid constraints */
for (con = td->con; con; con = con->next) {
@@ -4107,7 +4107,8 @@ static void headerTranslation(TransInfo *t, float vec[3], char str[MAX_INFO_LEN]
dist = len_v3(vec);
if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) {
- int i, do_split = t->scene->unit.flag & USER_UNIT_OPT_SPLIT ? 1 : 0;
+ const bool do_split = (t->scene->unit.flag & USER_UNIT_OPT_SPLIT) != 0;
+ int i;
for (i = 0; i < 3; i++) {
bUnit_AsString(&tvec[NUM_STR_REP_LEN * i], NUM_STR_REP_LEN, dvec[i] * t->scene->unit.scale_length,
@@ -4121,13 +4122,18 @@ static void headerTranslation(TransInfo *t, float vec[3], char str[MAX_INFO_LEN]
}
}
- if (!(t->flag & T_2D_EDIT) && t->scene->unit.system)
+ if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) {
+ const bool do_split = (t->scene->unit.flag & USER_UNIT_OPT_SPLIT) != 0;
bUnit_AsString(distvec, sizeof(distvec), dist * t->scene->unit.scale_length, 4, t->scene->unit.system,
- B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, false);
- else if (dist > 1e10f || dist < -1e10f) /* prevent string buffer overflow */
+ B_UNIT_LENGTH, do_split, false);
+ }
+ else if (dist > 1e10f || dist < -1e10f) {
+ /* prevent string buffer overflow */
BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4e", dist);
- else
+ }
+ else {
BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4f", dist);
+ }
if (t->flag & T_AUTOIK) {
short chainlen = t->settings->autoik_chainlen;
@@ -4571,7 +4577,8 @@ static void applyMaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
{
TransData *td;
float ratio;
- int i, initial_feather = false;
+ int i;
+ bool initial_feather = false;
char str[MAX_INFO_LEN];
ratio = t->values[0];