From 222c39fe7052c0c44eccdca630c5ca273da4d3df Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Mon, 28 Jun 2021 11:48:20 -0300 Subject: [PATCH] Transform: Move "Proportional Size" and "AutoIK-Len" values to the beginning of the header This prevents the text from shaking while transforming. --- .../transform/transform_mode_translate.c | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index 7ee8834c1fe..e68db21c7e0 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -115,6 +115,26 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ translate_dist_to_str(dist_str, sizeof(dist_str), dist, unit); + if (t->flag & T_PROP_EDIT_ALL) { + char prop_str[NUM_STR_REP_LEN]; + translate_dist_to_str(prop_str, sizeof(prop_str), t->prop_size, unit); + + ofs += BLI_snprintf_rlen(str + ofs, + UI_MAX_DRAW_STR - ofs, + "%s %s: %s ", + TIP_("Proportional Size"), + t->proptext, + prop_str); + } + + if (t->flag & T_AUTOIK) { + short chainlen = t->settings->autoik_chainlen; + if (chainlen) { + ofs += BLI_snprintf_rlen(str + ofs, UI_MAX_DRAW_STR - ofs, TIP_("AutoIK-Len: %d"), chainlen); + ofs += BLI_strncpy_rlen(str + ofs, " ", UI_MAX_DRAW_STR - ofs); + } + } + if (t->con.mode & CON_APPLY) { switch (t->num.idx_max) { case 0: @@ -133,7 +153,7 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ case 2: ofs += BLI_snprintf_rlen(str + ofs, UI_MAX_DRAW_STR - ofs, - "D: %s D: %s D: %s (%s)%s", + "D: %s D: %s D: %s (%s)%s", dvec_str[0], dvec_str[1], dvec_str[2], @@ -155,7 +175,7 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ else { ofs += BLI_snprintf_rlen(str + ofs, UI_MAX_DRAW_STR - ofs, - "Dx: %s Dy: %s Dz: %s (%s)%s", + "Dx: %s Dy: %s Dz: %s (%s)%s", dvec_str[0], dvec_str[1], dvec_str[2], @@ -164,26 +184,6 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ } } - if (t->flag & T_PROP_EDIT_ALL) { - char prop_str[NUM_STR_REP_LEN]; - translate_dist_to_str(prop_str, sizeof(prop_str), t->prop_size, unit); - - ofs += BLI_snprintf_rlen(str + ofs, - UI_MAX_DRAW_STR - ofs, - " %s %s: %s", - TIP_("Proportional Size"), - t->proptext, - prop_str); - } - - if (t->flag & T_AUTOIK) { - short chainlen = t->settings->autoik_chainlen; - if (chainlen) { - ofs += BLI_strncpy_rlen(str + ofs, " ", UI_MAX_DRAW_STR - ofs); - ofs += BLI_snprintf_rlen(str + ofs, UI_MAX_DRAW_STR - ofs, TIP_("AutoIK-Len: %d"), chainlen); - } - } - if (t->spacetype == SPACE_NODE) { SpaceNode *snode = (SpaceNode *)t->area->spacedata.first;