From a065caf8793cafe5508bffe572ba95e0017840b8 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 19 Jun 2012 12:44:58 -0700 Subject: Lock Position and Size keyframes to main track keyframes Signed-off-by: Jonathan Duran --- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'js/panels/Timeline/TimelineTrack.reel') 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, { newTween.tweenData.keyFrameMillisec = 0; newTween.tweenData.tweenID = 0; newTween.tweenData.spanPosition = 0; + newTween.tweenData.easing = "none"; newTween.tweenData.tweenedProperties = []; newTween.tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px"; newTween.tweenData.tweenedProperties["left"] = this.animatedElement.offsetLeft + "px"; newTween.tweenData.tweenedProperties["width"] = this.animatedElement.offsetWidth + "px"; newTween.tweenData.tweenedProperties["height"] = this.animatedElement.offsetHeight + "px"; this.tweens.push(newTween); + + this.createMatchingPositionSizeTween(newTween); + } else { newTween.tweenData.spanWidth = clickPos - this.tweens[this.tweens.length - 1].tweenData.keyFramePosition; newTween.tweenData.keyFramePosition = clickPos; @@ -787,21 +791,22 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { var animationDuration = (this.trackDuration / 1000) + "s"; this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration); this.nextKeyframe += 1; + + this.createMatchingPositionSizeTween(newTween); } - this.createMatchingPositionSizeTweens(clickPos); + this.application.ninja.currentDocument.model.needsSave = true; } }, - createMatchingPositionSizeTweens:{ - value:function (position) { - console.log(this.positionTracksRepetition); + createMatchingPositionSizeTween:{ + value:function (newTween) { var i; - var posTracks = this.positionTracksRepetition.length; + var posTracks = this.positionTracksRepetition.childComponents.length; for (i = 0; i < posTracks; i++) { - + this.positionTracksRepetition.childComponents[i].propTweens.push(newTween); } } }, @@ -812,8 +817,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { i, tweensLength = this.tweens.length-1, prevTween, nextTween, splitTweenIndex; - - consol.log(ev.target.className) + for(i=0; i