diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index f8f4f6b8..8f867d35 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -460,7 +460,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
460 | retrieveStoredTweens:{ | 460 | retrieveStoredTweens:{ |
461 | value:function () { | 461 | value:function () { |
462 | var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute | 462 | var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute |
463 | var animationTiming,trackTiming,currentMilliSec,currentMilliSecPerPixel,clickPosition,i = 0; | 463 | var currentMilliSec,currentMilliSecPerPixel,clickPosition,tempTiming,tempTimingInt,trackTiming,i = 0; |
464 | 464 | ||
465 | var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); | 465 | var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); |
466 | this.application.ninja.timeline.arrLayers[selectedIndex].created=true; | 466 | this.application.ninja.timeline.arrLayers[selectedIndex].created=true; |
@@ -468,11 +468,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
468 | if(this.animatedElement!==undefined){ | 468 | if(this.animatedElement!==undefined){ |
469 | this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); | 469 | this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); |
470 | if(this.animationName){ | 470 | if(this.animationName){ |
471 | animationTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); | 471 | trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); |
472 | trackTiming = animationTiming.split("s"); | ||
473 | currentMilliSec = trackTiming[0] * 1000; | ||
474 | currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); | ||
475 | clickPosition = currentMilliSec / currentMilliSecPerPixel; | ||
476 | this.nextKeyframe = 0; | 472 | this.nextKeyframe = 0; |
477 | 473 | ||
478 | this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); | 474 | this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); |
@@ -500,10 +496,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
500 | 496 | ||
501 | } | 497 | } |
502 | else { | 498 | else { |
499 | tempTiming = trackTiming.split("s"); | ||
500 | tempTimingInt = parseInt(tempTiming[0]); | ||
501 | this.trackDuration = tempTimingInt *1000; | ||
503 | percentValue = this.currentKeyframeRule[i].keyText; | 502 | percentValue = this.currentKeyframeRule[i].keyText; |
504 | splitValue = percentValue.split("%"); | 503 | splitValue = percentValue.split("%"); |
505 | fraction = splitValue[0] / 100; | 504 | fraction = splitValue[0] / 100; |
506 | currentMilliSec = fraction * trackTiming[0] * 1000; | 505 | currentMilliSec = fraction * this.trackDuration; |
507 | currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); | 506 | currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); |
508 | clickPosition = currentMilliSec / currentMilliSecPerPixel; | 507 | clickPosition = currentMilliSec / currentMilliSecPerPixel; |
509 | newTween.spanWidth = clickPosition - this.tweens[this.tweens.length - 1].keyFramePosition; | 508 | newTween.spanWidth = clickPosition - this.tweens[this.tweens.length - 1].keyFramePosition; |