Bugfix: Units for time translate transforms (action/nla editors) was messed up

When autosnap mode was nearest frame or nearest marker, this was incorrectly
converting the units to seconds, making this display unusable for anything.
This commit is contained in:
Joshua Leung 2014-06-16 21:44:08 +12:00
parent 8e722b0232
commit 37fce22201
Notes: blender-bot 2023-02-14 11:01:33 +01:00
Referenced by issue #41001, Crash when changing diffuse color
Referenced by issue #40888, Memory error when selecting Cycles render engine
1 changed files with 6 additions and 2 deletions

View File

@ -7342,13 +7342,17 @@ static void headerTimeTranslate(TransInfo *t, char str[MAX_INFO_LEN])
/* second step */
val = floorf((double)val / secf + 0.5);
}
else {
/* nearest frame/second/marker */
else if (autosnap == SACTSNAP_SECOND) {
/* nearest second */
val = (float)((double)val / secf);
}
if (autosnap == SACTSNAP_FRAME)
BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%d.00 (%.4f)", (int)val, val);
else if (autosnap == SACTSNAP_SECOND)
BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%d.00 sec (%.4f)", (int)val, val);
else if (autosnap == SACTSNAP_TSTEP)
BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f sec", val);
else
BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f", val);
}