aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 26ccfe09..1a8b6f4e 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -763,12 +763,16 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
763 newTween.tweenData.keyFrameMillisec = 0; 763 newTween.tweenData.keyFrameMillisec = 0;
764 newTween.tweenData.tweenID = 0; 764 newTween.tweenData.tweenID = 0;
765 newTween.tweenData.spanPosition = 0; 765 newTween.tweenData.spanPosition = 0;
766 newTween.tweenData.easing = "none";
766 newTween.tweenData.tweenedProperties = []; 767 newTween.tweenData.tweenedProperties = [];
767 newTween.tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px"; 768 newTween.tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px";
768 newTween.tweenData.tweenedProperties["left"] = this.animatedElement.offsetLeft + "px"; 769 newTween.tweenData.tweenedProperties["left"] = this.animatedElement.offsetLeft + "px";
769 newTween.tweenData.tweenedProperties["width"] = this.animatedElement.offsetWidth + "px"; 770 newTween.tweenData.tweenedProperties["width"] = this.animatedElement.offsetWidth + "px";
770 newTween.tweenData.tweenedProperties["height"] = this.animatedElement.offsetHeight + "px"; 771 newTween.tweenData.tweenedProperties["height"] = this.animatedElement.offsetHeight + "px";
771 this.tweens.push(newTween); 772 this.tweens.push(newTween);
773
774 this.createMatchingPositionSizeTween(newTween);
775
772 } else { 776 } else {
773 newTween.tweenData.spanWidth = clickPos - this.tweens[this.tweens.length - 1].tweenData.keyFramePosition; 777 newTween.tweenData.spanWidth = clickPos - this.tweens[this.tweens.length - 1].tweenData.keyFramePosition;
774 newTween.tweenData.keyFramePosition = clickPos; 778 newTween.tweenData.keyFramePosition = clickPos;
@@ -787,21 +791,22 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
787 var animationDuration = (this.trackDuration / 1000) + "s"; 791 var animationDuration = (this.trackDuration / 1000) + "s";
788 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration); 792 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration);
789 this.nextKeyframe += 1; 793 this.nextKeyframe += 1;
794
795 this.createMatchingPositionSizeTween(newTween);
790 } 796 }
791 797
792 this.createMatchingPositionSizeTweens(clickPos); 798
793 799
794 this.application.ninja.currentDocument.model.needsSave = true; 800 this.application.ninja.currentDocument.model.needsSave = true;
795 } 801 }
796 }, 802 },
797 803
798 createMatchingPositionSizeTweens:{ 804 createMatchingPositionSizeTween:{
799 value:function (position) { 805 value:function (newTween) {
800 console.log(this.positionTracksRepetition);
801 var i; 806 var i;
802 var posTracks = this.positionTracksRepetition.length; 807 var posTracks = this.positionTracksRepetition.childComponents.length;
803 for (i = 0; i < posTracks; i++) { 808 for (i = 0; i < posTracks; i++) {
804 809 this.positionTracksRepetition.childComponents[i].propTweens.push(newTween);
805 } 810 }
806 } 811 }
807 }, 812 },
@@ -812,8 +817,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
812 i, 817 i,
813 tweensLength = this.tweens.length-1, 818 tweensLength = this.tweens.length-1,
814 prevTween, nextTween, splitTweenIndex; 819 prevTween, nextTween, splitTweenIndex;
815 820
816 consol.log(ev.target.className)
817 for(i=0; i<tweensLength; i++){ 821 for(i=0; i<tweensLength; i++){
818 prevTween = this.tweens[i].tweenData.keyFramePosition; 822 prevTween = this.tweens[i].tweenData.keyFramePosition;
819 nextTween = this.tweens[i+1].tweenData.keyFramePosition; 823 nextTween = this.tweens[i+1].tweenData.keyFramePosition;