Transform: Move "Proportional Size" and "AutoIK-Len" values to the beginning of the header

This prevents the text from shaking while transforming.
This commit is contained in:
Germano Cavalcante 2021-06-28 11:48:20 -03:00
parent 8de878e202
commit 222c39fe70
1 changed files with 22 additions and 22 deletions

View File

@ -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;