From 33e54da07d024ece1d52041d4ed2bcc28b8cbca3 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 16 Jul 2012 15:38:59 -0700 Subject: Timeline: Ameliorate slowness when adding first keyframe to an element. --- js/panels/Timeline/Keyframe.reel/Keyframe.js | 4 ++-- js/panels/Timeline/Tween.reel/Tween.js | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js index b771f6f3..13902ddb 100644 --- a/js/panels/Timeline/Keyframe.reel/Keyframe.js +++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js @@ -158,7 +158,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { return; } this.isSelected=true; - this.element.style.left = (this.position - 6) + "px"; + //this.element.style.left = (this.position - 6) + "px"; Moved to draw cycle. this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; this.parentComponent.selectTween(); } @@ -167,7 +167,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, { deselectKeyframe:{ value:function () { this.isSelected = false; - this.element.style.left = (this.position - 5) + "px"; + // this.element.style.left = (this.position - 5) + "px"; Moved to draw cycle } } // ==== End Controllers diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 85fdfdc9..d41ad74f 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -229,7 +229,13 @@ var Tween = exports.Tween = Montage.create(Component, { prepareForDraw:{ value:function(){ if(this.initSelect){ - this.keyframe.selectKeyframe(); + // Select our new keyframe only if our parent is a main track. + // TODO: When we decouple all property tracks, this will go away. + if (typeof(this.parentComponent.parentComponent.trackType) === "undefined") { + if (this.tweenID > 0) { + this.keyframe.selectKeyframe(); + } + } this.initSelect = false; } } -- cgit v1.2.3