diff options
author | Falk David <falkdavid@gmx.de> | 2021-02-06 11:09:17 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2021-02-06 11:09:17 +0300 |
commit | 4cca64f4ad32f3c5509e40f931afdab550ff32d2 (patch) | |
tree | 55524f2114ee58fc4eccc9c8cf6ff51b40cb223d /source/blender/editors/transform/transform_mode_shrink_fatten.c | |
parent | a4a9d14ba71100259f19bd62e8c2f27cd8b7862f (diff) | |
parent | eccc57aa5c791009634ffe8a1e41472ce02317f5 (diff) |
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/editors/transform/transform_mode_shrink_fatten.c')
-rw-r--r-- | source/blender/editors/transform/transform_mode_shrink_fatten.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_mode_shrink_fatten.c b/source/blender/editors/transform/transform_mode_shrink_fatten.c index dd89f4fd983..a392a354449 100644 --- a/source/blender/editors/transform/transform_mode_shrink_fatten.c +++ b/source/blender/editors/transform/transform_mode_shrink_fatten.c @@ -64,6 +64,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) int i; char str[UI_MAX_DRAW_STR]; size_t ofs = 0; + UnitSettings *unit = &t->scene->unit; distance = t->values[0]; @@ -74,15 +75,21 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) t->values_final[0] = distance; /* header print for NumInput */ - ofs += BLI_strncpy_rlen(str + ofs, TIP_("Shrink/Fatten:"), sizeof(str) - ofs); + ofs += BLI_strncpy_rlen(str + ofs, TIP_("Shrink/Fatten: "), sizeof(str) - ofs); if (hasNumInput(&t->num)) { char c[NUM_STR_REP_LEN]; - outputNumInput(&(t->num), c, &t->scene->unit); - ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, " %s", c); + outputNumInput(&(t->num), c, unit); + ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, "%s", c); } else { /* default header print */ - ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, " %.4f", distance); + if (unit != NULL) { + ofs += BKE_unit_value_as_string( + str + ofs, sizeof(str) - ofs, distance * unit->scale_length, 4, B_UNIT_LENGTH, unit, true); + } + else { + ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, "%.4f", distance); + } } if (t->proptext[0]) { |