aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel
diff options
context:
space:
mode:
authorPushkar Joshi2012-03-02 12:36:34 -0800
committerPushkar Joshi2012-03-02 12:36:34 -0800
commitdc3c813320c8d3fb837d5d18e70ab35a53b116c1 (patch)
treeda417684de5e302d302ea617854015bd9a8ca17a /js/panels/Timeline/TimelineTrack.reel
parentd7d78d4a4e8cf82c56379d25efbe679b3b823abc (diff)
parent4419209a1fd850ab468209b562b66b0242b42a9c (diff)
downloadninja-dc3c813320c8d3fb837d5d18e70ab35a53b116c1.tar.gz
Merge branch 'brushtool' into pentool
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html5
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js9
2 files changed, 11 insertions, 3 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
index 158d666e..26d045d6 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
@@ -62,6 +62,11 @@
62 "boundObject" : {"@": "tweenRepetition"}, 62 "boundObject" : {"@": "tweenRepetition"},
63 "boundObjectPropertyPath" : "objectAtCurrentIteration.isTweenAnimated", 63 "boundObjectPropertyPath" : "objectAtCurrentIteration.isTweenAnimated",
64 "oneway" : false 64 "oneway" : false
65 },
66 "isClearing" : {
67 "boundObject" : {"@": "tweenRepetition"},
68 "boundObjectPropertyPath" : "objectAtCurrentIteration.isClearing",
69 "oneway" : false
65 } 70 }
66 } 71 }
67 }, 72 },
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;";