aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Tween.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/Tween.reel')
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js73
1 files changed, 3 insertions, 70 deletions
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 28c9a585..27828c3c 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -44,6 +44,7 @@ var Tween = exports.Tween = Montage.create(Component, {
44 }, 44 },
45 set: function(value){ 45 set: function(value){
46 this._spanWidth = value; 46 this._spanWidth = value;
47 this.tweenData.spanWidth = value;
47 this.needsDraw=true; 48 this.needsDraw=true;
48 } 49 }
49 }, 50 },
@@ -59,6 +60,7 @@ var Tween = exports.Tween = Montage.create(Component, {
59 }, 60 },
60 set:function (value) { 61 set:function (value) {
61 this._spanPosition = value; 62 this._spanPosition = value;
63 this.tweenData.spanPosition = value;
62 this.needsDraw=true; 64 this.needsDraw=true;
63 } 65 }
64 }, 66 },
@@ -74,6 +76,7 @@ var Tween = exports.Tween = Montage.create(Component, {
74 }, 76 },
75 set:function (value) { 77 set:function (value) {
76 this._keyFramePosition = value; 78 this._keyFramePosition = value;
79 this.tweenData.keyFramePosition = value;
77 this.needsDraw=true; 80 this.needsDraw=true;
78 } 81 }
79 }, 82 },
@@ -136,11 +139,6 @@ var Tween = exports.Tween = Montage.create(Component, {
136 } 139 }
137 }, 140 },
138 141
139 prepareForDraw:{
140 value:function(){
141 this.eventManager.addEventListener("tlZoomSlider", this, false);
142 }
143 },
144 142
145 draw:{ 143 draw:{
146 value:function () { 144 value:function () {
@@ -227,71 +225,6 @@ var Tween = exports.Tween = Montage.create(Component, {
227 // deselect the keyframe for this tween 225 // deselect the keyframe for this tween
228 this.keyframe.deselectKeyframe(); 226 this.keyframe.deselectKeyframe();
229 } 227 }
230 },
231
232 handleTlZoomSlider:{
233 value:function(event){
234 var currentMilliSecPerPixel , currentMilliSec , clickPos,i=0;
235
236 length = this.application.ninja.timeline.tempArray.length;
237 if(length > 0 && this.application.ninja.timeline.tempArray[length-1]!== this.parentComponent.parentComponent.trackID){
238 this.application.ninja.timeline.tempArray.push(this.parentComponent.parentComponent.trackID);
239 var i = this.application.ninja.timeline.tweenarray.length-1;
240 for(;this.currentTween = this.application.ninja.timeline.tweenarray[i];i--){
241 if(this.application.ninja.timeline.tweenarray[i].tweenID===0){
242 this.currentTween.spanWidth=0;
243 this.currentTween.spanPosition=0;
244 this.currentTween.keyFramePosition=0;
245 this.currentTween.keyFrameMillisec=0;
246 this.needsDraw=true;
247 }else{
248 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
249 currentMilliSec = this.currentTween.keyFrameMillisec;
250 clickPos = currentMilliSec / currentMilliSecPerPixel;
251 this.currentTween.spanWidth = clickPos-this.application.ninja.timeline.tweenarray[i+1].keyFramePosition;
252 this.currentTween.keyFramePosition = clickPos;
253 this.currentTween.spanPosition=clickPos-this.currentTween.spanWidth;
254 this.needsDraw=true;
255 }
256
257 }
258 this.application.ninja.timeline.tweenarray.length=0;
259 this.application.ninja.timeline.tweenarray.push(this);
260 }else if(length===0){
261 this.application.ninja.timeline.tempArray.push(this.parentComponent.parentComponent.trackID);
262 this.application.ninja.timeline.tweenarray.push(this);
263 }else{
264 this.application.ninja.timeline.tweenarray.push(this);
265 }
266
267 var levelNumber = this.application.ninja.timeline.getLayerIndexByID(this.parentComponent.parentComponent.trackID);
268 var k = this.application.ninja.timeline.tweenarray.length-1;
269 if(this.parentComponent.parentComponent.tweens.length === this.application.ninja.timeline.tweenarray.length && levelNumber===0){
270 for(;this.currentTween = this.application.ninja.timeline.tweenarray[k];k--){
271 if(this.application.ninja.timeline.tweenarray[k].tweenID===0){
272 this.currentTween.spanWidth=0;
273 this.currentTween.spanPosition=0;
274 this.currentTween.keyFramePosition=0;
275 this.currentTween.keyFrameMillisec=0;
276 this.needsDraw=true;
277 }else{
278 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
279 currentMilliSec = this.currentTween.keyFrameMillisec;
280 clickPos = currentMilliSec / currentMilliSecPerPixel;
281 this.currentTween.spanWidth = clickPos-this.application.ninja.timeline.tweenarray[k+1].keyFramePosition;
282 this.currentTween.keyFramePosition = clickPos;
283 this.currentTween.spanPosition=clickPos-this.currentTween.spanWidth;
284 this.needsDraw=true;
285 }
286
287 }
288 this.application.ninja.timeline.tempArray.length=0;
289 this.application.ninja.timeline.tweenarray.length=0;
290 }
291
292
293
294 }
295 } 228 }
296 229
297}); 230});