From aabd9b98341308cd0d276e6e788b7a3f9531c394 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Thu, 21 Jun 2012 11:32:20 -0700 Subject: Timeline: Bug Fix: Document switching was doubling position tracks. --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 5 +++++ 1 file changed, 5 insertions(+) (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 bf380e00..3cf754b8 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -1051,6 +1051,11 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { createPositionTracks:{ value:function(){ // create track objects for position and transform tracks and push into arrays + + // ... but only do it if we haven't already. + if (this.arrPositionTracks.length > 0) { + return; + } // create 'left' track var newLeftTrack = {}; -- cgit v1.2.3 From 21edfc9a02df0ab4360d5eb41f9ef036500c681b Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 25 Jun 2012 08:12:21 -0700 Subject: Timeline Fix - reopen subprop keyframes for Position and Size correctly Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 10 ++-------- 1 file changed, 2 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 85fce1ec..68ea928a 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -709,15 +709,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.updateKeyframeRule(); } else { this.handleNewTween(ev); - - // Split a tween! - //this.splitTweenAt(this.application.ninja.timeline.playheadmarker.offsetLeft); this.updateKeyframeRule(); } } else if(ev.actionType == "remove"){ this.removeTween(); + this.updateKeyframeRule(); } - } }, @@ -800,8 +797,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.createMatchingPositionSizeTween(newTween); } - - this.application.ninja.currentDocument.model.needsSave = true; } }, @@ -995,6 +990,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.tweenData.easing = "none"; } this.tweens.push(newTween); + this.createMatchingPositionSizeTween(newTween); } this.nextKeyframe += 1; } @@ -1022,8 +1018,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { value:function(ruleSet){ for(var i in ruleSet){ var styleProp = ruleSet[i][0].style[0]; - //console.log(styleProp); - //console.log(ruleSet[i]); this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp, ruleSet[i]); } } -- cgit v1.2.3 From 616ade06c8f669d18c27d27c3ee46a9c844a54ca Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 26 Jun 2012 08:12:33 -0700 Subject: Timeline Bug fixes Fix keyframe selection updating stage for sub props. Fix tween 0 for sub props on re-open. Fix repetition mismatch for styles and position tracks. Signed-off-by: Jonathan Duran --- .../Timeline/TimelineTrack.reel/TimelineTrack.html | 21 +++++++++++---------- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'js/panels/Timeline/TimelineTrack.reel') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html index 79014ae6..658764c8 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html @@ -56,7 +56,7 @@ "styleTrackRepetition": { "prototype": "montage/ui/repetition.reel", "properties": { - "element": {"#": "content-styles"}, + "element": {"#": "content_style_tracks"}, "isSelectionEnabled" : false }, "bindings": { @@ -195,22 +195,23 @@
-
-
-
+
+ +
-
- -
-
-
+
+ +
+
+
+
+
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index dc1a5d99..7576b33f 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -969,6 +969,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.tweenData.tweenID = 0; newTween.tweenData.spanPosition = 0; this.tweens.push(newTween); + this.createMatchingPositionSizeTween(newTween); } else { tempTiming = trackTiming.split("s"); -- cgit v1.2.3 From e1d35d82d144d51a107a4facd47b47cffde79bcf Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 26 Jun 2012 08:59:32 -0700 Subject: Move time marker when clicking anywhere in timeline tracks Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 8 ++++++++ 1 file changed, 8 insertions(+) (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 7576b33f..e6b773c9 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -682,6 +682,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { // TEMP - if the SHIFT key is down, add a new keyframe or split an existing span // This needs to move to a keyboard shortcut that is TBD var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); + + this.application.ninja.timeline.playheadmarker.style.left = ev.offsetX + "px"; + var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); + var currentMillisec = currentMillisecPerPixel * ev.offsetX; + this.application.ninja.timeline.updateTimeText(currentMillisec); + if (ev.shiftKey) { if (this.tweens.length < 1) { this.insertTween(0); @@ -1051,6 +1057,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { // build the new keyframe string var keyframeString = "@-webkit-keyframes " + this.animationName + " {"; + console.log(this.animationName); + for (var i = 0; i < this.tweens.length; i++) { var keyMill = parseInt(this.tweens[i].tweenData.keyFrameMillisec); // TODO - trackDur should be parseFloat rounded to significant digits -- cgit v1.2.3 From f0d4d89d856b99da1ca8dd3366c48bb76ba6b1f6 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 26 Jun 2012 09:08:47 -0700 Subject: Fix play marker appearing in wrong position when clicking on a tween Signed-off-by: Jonathan Duran --- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 35 ++++++++++++---------- 1 file changed, 20 insertions(+), 15 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 e6b773c9..3a8d1ff3 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -683,9 +683,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { // This needs to move to a keyboard shortcut that is TBD var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); - this.application.ninja.timeline.playheadmarker.style.left = ev.offsetX + "px"; + var targetElementOffset = this.findXOffset(ev.currentTarget), + position = (event.pageX - targetElementOffset) - 18; + + this.application.ninja.timeline.playheadmarker.style.left = position + "px"; var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); - var currentMillisec = currentMillisecPerPixel * ev.offsetX; + var currentMillisec = currentMillisecPerPixel * position; this.application.ninja.timeline.updateTimeText(currentMillisec); if (ev.shiftKey) { @@ -733,19 +736,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { } else { // We will be splitting a tween. Get the x-coordinate of the mouse click within the target element. // You'd think you could use the event.x info for that, right? NO. We must use page values, calculating offsets and scrolling. - - // Here's an easy function that adds up offsets and scrolls and returns the page x value of an element - var findXOffset = function(obj) { - var curleft = 0; - if (obj.offsetParent) { - do { - curleft += (obj.offsetLeft-obj.scrollLeft); - - } while (obj = obj.offsetParent); - } - return curleft; - } - var targetElementOffset = findXOffset(ev.currentTarget), + var targetElementOffset = this.findXOffset(ev.currentTarget), position = event.pageX - targetElementOffset; this.splitTweenAt(position-18); @@ -753,6 +744,20 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { } }, + findXOffset:{ + value:function (obj) { + // Here's an easy function that adds up offsets and scrolls and returns the page x value of an element + var curleft = 0; + if (obj.offsetParent) { + do { + curleft += (obj.offsetLeft - obj.scrollLeft); + + } while (obj = obj.offsetParent); + } + return curleft; + } + }, + insertTween:{ value:function (clickPos) { var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); -- cgit v1.2.3