aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Tween.reel/Tween.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/Tween.reel/Tween.js')
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js120
1 files changed, 63 insertions, 57 deletions
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 28c9a585..bd62a212 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -230,68 +230,74 @@ var Tween = exports.Tween = Montage.create(Component, {
230 }, 230 },
231 231
232 handleTlZoomSlider:{ 232 handleTlZoomSlider:{
233 value:function(event){ 233 value:function(event){
234 var currentMilliSecPerPixel , currentMilliSec , clickPos,i=0; 234 var currentMilliSecPerPixel , currentMilliSec , clickPos,thingToPush;
235 235
236 length = this.application.ninja.timeline.tempArray.length; 236 length = this.application.ninja.timeline.tempArray.length;
237 if(length > 0 && this.application.ninja.timeline.tempArray[length-1]!== this.parentComponent.parentComponent.trackID){ 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); 238 this.application.ninja.timeline.tempArray.push(this.parentComponent.parentComponent.trackID);
239 var i = this.application.ninja.timeline.tweenarray.length-1; 239 var i = this.application.ninja.timeline.tweenarray.length-1;
240 for(;this.currentTween = this.application.ninja.timeline.tweenarray[i];i--){ 240 for(var index=0;this.currentTween = this.parentComponent.parentComponent.tweens[index];i--,index++){
241 if(this.application.ninja.timeline.tweenarray[i].tweenID===0){ 241 if(this.parentComponent.parentComponent.tweens[index].tweenData.tweenID===0){
242 this.currentTween.spanWidth=0; 242 this.currentTween.tweenData.spanWidth=0;
243 this.currentTween.spanPosition=0; 243 this.currentTween.tweenData.spanPosition=0;
244 this.currentTween.keyFramePosition=0; 244 this.currentTween.tweenData.keyFramePosition=0;
245 this.currentTween.keyFrameMillisec=0; 245 this.currentTween.tweenData.keyFrameMillisec=0;
246 this.needsDraw=true; 246 this.setData();
247 }else{ 247 }else{
248 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); 248 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
249 currentMilliSec = this.currentTween.keyFrameMillisec; 249 currentMilliSec = this.currentTween.tweenData.keyFrameMillisec;
250 clickPos = currentMilliSec / currentMilliSecPerPixel; 250 clickPos = currentMilliSec / currentMilliSecPerPixel;
251 this.currentTween.spanWidth = clickPos-this.application.ninja.timeline.tweenarray[i+1].keyFramePosition; 251 this.currentTween.tweenData.spanWidth = clickPos-this.application.ninja.timeline.tweenarray[i+1].keyFramePosition;
252 this.currentTween.keyFramePosition = clickPos; 252 this.currentTween.tweenData.keyFramePosition = clickPos;
253 this.currentTween.spanPosition=clickPos-this.currentTween.spanWidth; 253 this.currentTween.tweenData.spanPosition=clickPos-this.currentTween.tweenData.spanWidth;
254 this.needsDraw=true; 254 this.setData();
255 } 255 }
256 256
257 }
258 this.application.ninja.timeline.tweenarray=[];
259 thingToPush = {};
260 thingToPush.tweenID = this.tweenID;
261 thingToPush.keyFramePosition = this.keyFramePosition;
262 this.application.ninja.timeline.tweenarray.push(thingToPush);
263 }else if(length===0){
264 this.application.ninja.timeline.tempArray.push(this.parentComponent.parentComponent.trackID);
265 thingToPush = {};
266 thingToPush.tweenID = this.tweenID;
267 thingToPush.keyFramePosition = this.keyFramePosition;
268 this.application.ninja.timeline.tweenarray.push(thingToPush);
269 }else{
270 thingToPush = {};
271 thingToPush.tweenID = this.tweenID;
272 thingToPush.keyFramePosition = this.keyFramePosition;
273 this.application.ninja.timeline.tweenarray.push(thingToPush);
257 } 274 }
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 275
267 var levelNumber = this.application.ninja.timeline.getLayerIndexByID(this.parentComponent.parentComponent.trackID); 276 var levelNumber = this.application.ninja.timeline.getLayerIndexByID(this.parentComponent.parentComponent.trackID);
268 var k = this.application.ninja.timeline.tweenarray.length-1; 277 var k = this.application.ninja.timeline.tweenarray.length-1;
269 if(this.parentComponent.parentComponent.tweens.length === this.application.ninja.timeline.tweenarray.length && levelNumber===0){ 278 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--){ 279 for(var indexValue=0;this.currentTween = this.parentComponent.parentComponent.tweens[indexValue];k--,indexValue++){
271 if(this.application.ninja.timeline.tweenarray[k].tweenID===0){ 280 if(this.parentComponent.parentComponent.tweens[indexValue].tweenData.tweenID===0){
272 this.currentTween.spanWidth=0; 281 this.currentTween.tweenData.spanWidth=0;
273 this.currentTween.spanPosition=0; 282 this.currentTween.tweenData.spanPosition=0;
274 this.currentTween.keyFramePosition=0; 283 this.currentTween.tweenData.keyFramePosition=0;
275 this.currentTween.keyFrameMillisec=0; 284 this.currentTween.tweenData.keyFrameMillisec=0;
276 this.needsDraw=true; 285 this.setData();
277 }else{ 286 }else{
278 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); 287 currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
279 currentMilliSec = this.currentTween.keyFrameMillisec; 288 currentMilliSec = this.currentTween.tweenData.keyFrameMillisec;
280 clickPos = currentMilliSec / currentMilliSecPerPixel; 289 clickPos = currentMilliSec / currentMilliSecPerPixel;
281 this.currentTween.spanWidth = clickPos-this.application.ninja.timeline.tweenarray[k+1].keyFramePosition; 290 this.currentTween.tweenData.spanWidth = clickPos-this.application.ninja.timeline.tweenarray[k+1].keyFramePosition;
282 this.currentTween.keyFramePosition = clickPos; 291 this.currentTween.tweenData.keyFramePosition = clickPos;
283 this.currentTween.spanPosition=clickPos-this.currentTween.spanWidth; 292 this.currentTween.tweenData.spanPosition=clickPos-this.currentTween.tweenData.spanWidth;
284 this.needsDraw=true; 293 this.setData();
285 } 294 }
286 295
296 }
297 this.application.ninja.timeline.tempArray=[];
298 this.application.ninja.timeline.tweenarray=[];
287 } 299 }
288 this.application.ninja.timeline.tempArray.length=0;
289 this.application.ninja.timeline.tweenarray.length=0;
290 } 300 }
291
292
293
294 } 301 }
295 }
296 302
297}); 303 });