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:
authorJoshua Leung <aligorith@gmail.com>2014-06-16 13:44:08 +0400
committerJoshua Leung <aligorith@gmail.com>2014-06-16 13:46:03 +0400
commit37fce22201b4f6f7be3b130f3c46c2220312e6cb (patch)
treea303ddd313bc0d0fb7674ae145af745c7c13ccfe /source/blender/editors/transform/transform.c
parent8e722b02320e4681e51f9cf2440d122bf30fbeae (diff)
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.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ab0bc061c32..33d52ec1a00 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -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);
}