From 47488a6ff1b7fc32e2485b3dd82afe207b936b35 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 24 Apr 2012 08:46:22 -0700 Subject: Turn on width and height as tweenable properties Signed-off-by: Jonathan Duran --- js/panels/Timeline/Tween.reel/Tween.js | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'js/panels/Timeline/Tween.reel/Tween.js') diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 7dcd397c..b13a037f 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -186,11 +186,36 @@ var Tween = exports.Tween = Montage.create(Component, { setAbsoluteTweenProperties:{ value:function (eventDetail) { //console.log(eventDetail); - if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) { + + // top + if(this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"]){ this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop; + } + + // left + if(this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]){ this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft; - this.parentComponent.parentComponent.updateKeyframeRule(); } + + // width + if (this.parentComponent.parentComponent.animatedElement.offsetWidth != this.tweenedProperties["width"]){ + this.tweenedProperties["width"] = this.parentComponent.parentComponent.animatedElement.offsetWidth; + } + + // height + if (this.parentComponent.parentComponent.animatedElement.offsetHeight != this.tweenedProperties["height"]){ + this.tweenedProperties["height"] = this.parentComponent.parentComponent.animatedElement.offsetHeight; + } + + // skewX + + // skewY + + // rotation + + // tell track to update css rule + this.parentComponent.parentComponent.updateKeyframeRule(); + // highlight the tween's span this.tweenspan.highlightSpan(); this.isTweenAnimated = true; -- cgit v1.2.3