aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 55c84dce..bf97c0fd 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -377,7 +377,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
377 // This needs to move to a keyboard shortcut that is TBD 377 // This needs to move to a keyboard shortcut that is TBD
378 378
379 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 379 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
380 //this.application.ninja.timeline.selectLayer(selectIndex);
381 380
382 if (ev.shiftKey) { 381 if (ev.shiftKey) {
383 if (this.application.ninja.timeline.arrLayers[selectedIndex].elementsList.length == 1) { 382 if (this.application.ninja.timeline.arrLayers[selectedIndex].elementsList.length == 1) {
@@ -520,6 +519,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
520 i++; 519 i++;
521 this.nextKeyframe += 1; 520 this.nextKeyframe += 1;
522 } 521 }
522 this.isTrackAnimated = true;
523 } 523 }
524 } 524 }
525 else{ 525 else{
@@ -533,7 +533,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
533 this.tweens[0].tweenedProperties["top"] = this.animatedElement.offsetTop; 533 this.tweens[0].tweenedProperties["top"] = this.animatedElement.offsetTop;
534 this.tweens[0].tweenedProperties["left"] = this.animatedElement.offsetLeft; 534 this.tweens[0].tweenedProperties["left"] = this.animatedElement.offsetLeft;
535 var animationDuration = Math.round(this.trackDuration / 1000) + "s"; 535 var animationDuration = Math.round(this.trackDuration / 1000) + "s";
536 this.animationName = "animation_" + this.animatedElement.className; 536 this.animationName = "animation_" + this.animatedElement.classList[0];
537 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", this.animationName); 537 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", this.animationName);
538 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration); 538 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration);
539 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", "infinite"); 539 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", "infinite");
@@ -553,7 +553,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
553 var keyframeString = "@-webkit-keyframes " + this.animationName + " {"; 553 var keyframeString = "@-webkit-keyframes " + this.animationName + " {";
554 554
555 for (var i = 0; i < this.tweens.length; i++) { 555 for (var i = 0; i < this.tweens.length; i++) {
556 var keyframePercent = Math.round((this.tweens[i].keyFrameMillisec / this.trackDuration) * 100) + "%"; 556 var keyMill = parseInt(this.tweens[i].keyFrameMillisec);
557 // TODO - trackDur should be parseFloat rounded to significant digits
558 var trackDur = parseInt(this.trackDuration);
559 var keyframePercent = Math.round((keyMill / trackDur) * 100) + "%";
557 var keyframePropertyString = " " + keyframePercent + " {"; 560 var keyframePropertyString = " " + keyframePercent + " {";
558 keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;"; 561 keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;";
559 keyframePropertyString += " left: " + this.tweens[i].tweenedProperties["left"] + "px;"; 562 keyframePropertyString += " left: " + this.tweens[i].tweenedProperties["left"] + "px;";