From 9aa987003f0c7866e66aabcc7d9cc2b9da8ed91c Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 26 Jun 2012 13:49:03 -0700 Subject: Timeline: Bug fix: Indexing on styles when loading files. --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 98989022..d4eabbf5 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -72,6 +72,19 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.trackData.isVisible = value; } }, + + _stageElement: { + value: null + }, + stageElement: { + get: function() { + return this._stageElement; + }, + set: function(newVal) { + this._stageElement = newVal; + this.trackData.stageElement = newVal; + } + }, // Are the various collapsers collapsed or not _isMainCollapsed:{ @@ -484,6 +497,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.isStyleCollapsed = this.trackData.isStyleCollapsed; this.trackPosition = this.trackData.trackPosition; this.isVisible = this.trackData.isVisible; + this.stageElement = this.trackData.stageElement; this.trackEditorProperty = "master"; this.needsDraw = true; } -- cgit v1.2.3 From ab9d14780eed98f39786fae4518e69861b34bad7 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 26 Jun 2012 14:56:58 -0700 Subject: Timeline: Bug fix: Keyboard shortcut now works for adding keyframes, including splitting tweens. --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index d4eabbf5..297423dd 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -743,6 +743,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { handleNewTween:{ value:function (ev) { + if (ev.offsetX > this.tweens[this.tweens.length - 1].tweenData.keyFramePosition) { var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); this.application.ninja.timeline.selectLayer(selectedIndex, false); @@ -750,10 +751,13 @@ 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. - var targetElementOffset = this.findXOffset(ev.currentTarget), - position = event.pageX - targetElementOffset; - - this.splitTweenAt(position-18); + if (typeof(ev.currentTarget) === "undefined") { + this.splitTweenAt(ev.offsetX); + } else { + var targetElementOffset = this.findXOffset(ev.currentTarget), + position = event.pageX - targetElementOffset; + this.splitTweenAt(position-18); + } } } }, @@ -762,6 +766,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { 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 (typeof(obj) === "undefined") { + //debugger; + } if (obj.offsetParent) { do { curleft += (obj.offsetLeft - obj.scrollLeft); -- cgit v1.2.3 From 45a5deac8ee1e38a6835275230f947b6aa8fb62a Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Tue, 26 Jun 2012 15:13:05 -0700 Subject: Timeline: Bug fix: Adding or splitting tweens on multiple layers at once will no longer change the selection. --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 297423dd..014d3f34 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -706,6 +706,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this.application.ninja.timeline.updateTimeText(currentMillisec); if (ev.shiftKey) { + var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); + this.application.ninja.timeline.selectLayer(selectedIndex, true); if (this.tweens.length < 1) { this.insertTween(0); this.addAnimationRuleToElement(ev); @@ -781,9 +783,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { insertTween:{ value:function (clickPos) { - var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); - this.application.ninja.timeline.selectLayer(selectedIndex, true); - var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); var currentMillisec = currentMillisecPerPixel * clickPos; this.trackDuration = currentMillisec; -- cgit v1.2.3