From 3487d0596ff64a3bfbfc00e8187e34d9eb2ba0ab Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 29 Jun 2012 13:23:30 -0700 Subject: Timeline: Bug fix: IKNINJA-1857, "Using keyboard shortcut for chrome-preview causes each layer in the timeline to remain selected even when clicking on another layer." --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index b0ab3b19..4c349247 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1369,8 +1369,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { targetIndex = 0, isAlreadySelected = false, indexAlreadySelected = 0, - indexLastClicked = 0; - + indexLastClicked = 0, + ua = navigator.userAgent.toLowerCase(), + boolCommandControlKeyIsPressed = false; + + // Check to see if either the Command key (macs) or Control key (windows) is being pressed + if (ua.indexOf("mac") > -1) { + if (event.metaKey === true) { + boolCommandControlKeyIsPressed = true; + } + } else { + if (this._isControlPressed === true) { + boolCommandControlKeyIsPressed = true; + } + } + // Did the mousedown event originate within a layer? if (ptrParent === false) { // No it did not. Do nothing. @@ -1406,8 +1419,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } else { // Something is already selected. What do do depends on whether // or not other keys are pressed. - if (this._isControlPressed === true) { - // Control key is being pressed, so we need to + if (boolCommandControlKeyIsPressed === true) { + // Control or Command key is being pressed, so we need to // either add the current layer to selectedLayers // or remove it if it's already there. if (this.currentLayersSelected === false) { @@ -1467,9 +1480,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Control key has been pressed this._isControlPressed = true; } + /* if (event.metaKey === true) { this._isControlPressed = true; } + */ } }, -- cgit v1.2.3 From f065c2bc664e9c8e4e97f8b6f6b684c310233f89 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 29 Jun 2012 14:21:08 -0700 Subject: Timeline: Bug fix: Unable to reselect a layer with control-click that was previously just deselected with control-click. (Yes, that's a weird one.) --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 4c349247..7deaf0d1 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1368,7 +1368,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { arrLayersLength = arrLayers.length, targetIndex = 0, isAlreadySelected = false, - indexAlreadySelected = 0, + indexAlreadySelected = -5, indexLastClicked = 0, ua = navigator.userAgent.toLowerCase(), boolCommandControlKeyIsPressed = false; @@ -1383,6 +1383,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { boolCommandControlKeyIsPressed = true; } } + // Did the mousedown event originate within a layer? if (ptrParent === false) { @@ -1400,17 +1401,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Did we just click on a layer that's already selected? if (this.currentLayersSelected !== false) { - indexAlreadySelected = this.currentLayersSelected.indexOf(targetIndex); + for (i = 0; i < this.currentLayersSelected.length; i++) { + if (this.currentLayersSelected[i] === targetIndex) { + indexAlreadySelected = i; + } + } } if (indexAlreadySelected > -1) { isAlreadySelected = true; } - - /* - if (targetIndex > -1) { - indexLastClicked = targetIndex; - } - */ // Now, do the selection based on all of that information. if (this.currentLayersSelected.length === 0) { @@ -1425,7 +1424,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // or remove it if it's already there. if (this.currentLayersSelected === false) { this.currentLayersSelected = []; - //this.currentLayerSelected = false; } if (isAlreadySelected === false) { this.currentLayersSelected.push(targetIndex); @@ -1457,9 +1455,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.currentLayersSelected = [targetIndex]; this.lastLayerClicked = targetIndex; } - } - //this._captureSelection = true; this.selectLayers(this.currentLayersSelected); this.updateStageSelection(); } -- cgit v1.2.3 From 2fa7782ef03fcbcd4cd176ca4850b764478da342 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 2 Jul 2012 08:45:08 -0700 Subject: select keyframe when first created Signed-off-by: Jonathan Duran --- js/panels/Timeline/Tween.reel/Tween.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js') diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 89f18f98..fe9b70d3 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -170,6 +170,12 @@ var Tween = exports.Tween = Montage.create(Component, { }, + prepareForDraw:{ + value:function(){ + this.keyframe.selectKeyframe(); + } + }, + draw:{ value:function () { this.tweenspan.element.style.width = this.spanWidth + "px"; -- cgit v1.2.3 From 2bba5361f817e96b4f84bdf5e472358da3dcec77 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 2 Jul 2012 09:13:21 -0700 Subject: Fix 3d rotate tweens not showing up Signed-off-by: Jonathan Duran --- js/panels/Timeline/Tween.reel/Tween.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index fe9b70d3..ae8acc57 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -250,7 +250,7 @@ var Tween = exports.Tween = Montage.create(Component, { this.isTweenAnimated = true; } - if (eventDetail.source === "translateTool") { + if (eventDetail.source === "translateTool" || eventDetail.source === "rotateTool") { var arrMat = eventDetail.data.value[0].properties.mat, strTweenProperty = "perspective(1400) matrix3d(" + arrMat.join() + ")"; -- cgit v1.2.3 From 0ea5607c3760852b1fe63ad568b4db064129955b Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 2 Jul 2012 13:45:28 -0700 Subject: Fix performance bug when moving between nested levels Signed-off-by: Jonathan Duran --- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 6 ++++++ js/panels/Timeline/Tween.reel/Tween.js | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 26ce526f..8953888b 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -797,6 +797,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.tweenData.tweenID = 0; newTween.tweenData.spanPosition = 0; newTween.tweenData.easing = "none"; + newTween.tweenData.initSelect = true; newTween.tweenData.tweenedProperties = []; newTween.tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px"; newTween.tweenData.tweenedProperties["left"] = this.animatedElement.offsetLeft + "px"; @@ -813,6 +814,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.tweenData.tweenID = this.nextKeyframe; newTween.tweenData.spanPosition = clickPos - newTween.tweenData.spanWidth; newTween.tweenData.easing = "none"; + newTween.tweenData.initSelect = true; newTween.tweenData.tweenedProperties = []; newTween.tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px"; newTween.tweenData.tweenedProperties["left"] = this.animatedElement.offsetLeft + "px"; @@ -920,6 +922,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTweenToInsert.tweenData.tweenID = this.tweens.length; newTweenToInsert.tweenData.spanPosition = position - newTweenToInsert.tweenData.spanWidth; newTweenToInsert.tweenData.tweenedProperties = []; + newTweenToInsert.tweenData.easing = "none"; + newTweenToInsert.tweenData.initSelect = true; newTweenToInsert.tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px"; newTweenToInsert.tweenData.tweenedProperties["left"] = this.animatedElement.offsetLeft + "px"; newTweenToInsert.tweenData.tweenedProperties["width"] = this.animatedElement.offsetWidth + "px"; @@ -999,6 +1003,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.tweenData.keyFrameMillisec = 0; newTween.tweenData.tweenID = 0; newTween.tweenData.spanPosition = 0; + newTween.tweenData.initSelect = false; this.tweens.push(newTween); this.createMatchingPositionSizeTween(newTween); } @@ -1016,6 +1021,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.tweenData.keyFramePosition = clickPosition; newTween.tweenData.keyFrameMillisec = currentMilliSec; newTween.tweenData.tweenID = this.nextKeyframe; + newTween.tweenData.initSelect = false; newTween.tweenData.spanPosition =clickPosition - newTween.tweenData.spanWidth; newTween.tweenData.easing = this.currentKeyframeRule[i].style.webkitAnimationName; if (newTween.tweenData.easing == "") { diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index ae8acc57..0d189fba 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -170,9 +170,26 @@ var Tween = exports.Tween = Montage.create(Component, { }, + _initSelect:{ + value: null + }, + initSelect:{ + serializable:true, + get:function () { + return this._initSelect; + }, + set:function (newVal) { + this._initSelect = newVal; + this.tweenData.initSelect = newVal; + } + }, + prepareForDraw:{ value:function(){ - this.keyframe.selectKeyframe(); + if(this.initSelect){ + this.keyframe.selectKeyframe(); + this.initSelect = false; + } } }, @@ -200,6 +217,7 @@ var Tween = exports.Tween = Montage.create(Component, { this.tweenedProperties = this.tweenData.tweenedProperties; this.isTweenAnimated = this.tweenData.isTweenAnimated; this.easing = this.tweenData.easing; + this.initSelect = this.tweenData.initSelect; this.needsDraw = true; } }, -- cgit v1.2.3 From 0d7918cb127f06adab5515edde72dccc137473f5 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 3 Jul 2012 10:01:57 -0700 Subject: Fix re-open 3D tweens correctly Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 8953888b..b1e8af8a 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -981,14 +981,14 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { for(j=0; j