From 6f1d1232e54d3d30b24abe0319dcfe5f4dc30f66 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 2 Mar 2012 14:55:26 -0800 Subject: Support writing and reading of animation duration with millseconds Removed math rounding so that animation durations won't round to full seconds anymore. Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 051d56c2..7120298c 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -453,7 +453,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.tweens.push(newTween); // update the animation duration - var animationDuration = Math.round(this.trackDuration / 1000) + "s"; + var animationDuration = (this.trackDuration / 1000) + "s"; this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration); this.nextKeyframe += 1; } @@ -470,7 +470,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { retrieveStoredTweens:{ value:function () { var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute; - var currentMilliSec,currentMilliSecPerPixel,clickPosition,tempTiming,tempTimingInt,trackTiming,i = 0; + var currentMilliSec,currentMilliSecPerPixel,clickPosition,tempTiming,tempTimingFloat,trackTiming,i = 0; var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); this.application.ninja.timeline.arrLayers[selectedIndex].created=true; @@ -506,8 +506,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { } else { tempTiming = trackTiming.split("s"); - tempTimingInt = parseInt(tempTiming[0]); - this.trackDuration = tempTimingInt *1000; + tempTimingFloat = parseFloat(tempTiming[0]); + this.trackDuration = tempTimingFloat *1000; percentValue = this.currentKeyframeRule[i].keyText; splitValue = percentValue.split("%"); fraction = splitValue[0] / 100; -- cgit v1.2.3