aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js42
1 files changed, 27 insertions, 15 deletions
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index db368caf..c0949f93 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -206,6 +206,7 @@ var Tween = exports.Tween = Montage.create(Component, {
206 if (event.detail.source && event.detail.source !== "tween") { 206 if (event.detail.source && event.detail.source !== "tween") {
207 207
208 if(this.parentComponent.parentComponent.isSubproperty){ 208 if(this.parentComponent.parentComponent.isSubproperty){
209 console.log("setting style tween property")
209 this.setStyleTweenProperty(event.detail); 210 this.setStyleTweenProperty(event.detail);
210 } else { 211 } else {
211 // check for correct element selection 212 // check for correct element selection
@@ -221,21 +222,32 @@ var Tween = exports.Tween = Montage.create(Component, {
221 222
222 setTweenProperties:{ 223 setTweenProperties:{
223 value:function (eventDetail) { 224 value:function (eventDetail) {
224 if(this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"]){ 225 if (eventDetail.source === "SelectionTool") {
225 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop + "px"; 226 if(this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"]){
226 } 227 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop + "px";
227 if(this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]){ 228 }
228 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft + "px"; 229 if(this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]){
229 } 230 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft + "px";
230 if (this.parentComponent.parentComponent.animatedElement.offsetWidth != this.tweenedProperties["width"]){ 231 }
231 this.tweenedProperties["width"] = this.parentComponent.parentComponent.animatedElement.offsetWidth + "px"; 232 if (this.parentComponent.parentComponent.animatedElement.offsetWidth != this.tweenedProperties["width"]){
232 } 233 this.tweenedProperties["width"] = this.parentComponent.parentComponent.animatedElement.offsetWidth + "px";
233 if (this.parentComponent.parentComponent.animatedElement.offsetHeight != this.tweenedProperties["height"]){ 234 }
234 this.tweenedProperties["height"] = this.parentComponent.parentComponent.animatedElement.offsetHeight + "px"; 235 if (this.parentComponent.parentComponent.animatedElement.offsetHeight != this.tweenedProperties["height"]){
235 } 236 this.tweenedProperties["height"] = this.parentComponent.parentComponent.animatedElement.offsetHeight + "px";
236 // tell track to update css rule 237 }
237 this.parentComponent.parentComponent.updateKeyframeRule(); 238 // tell track to update css rule
238 this.isTweenAnimated = true; 239 this.parentComponent.parentComponent.updateKeyframeRule();
240 this.isTweenAnimated = true;
241 }
242
243 if (eventDetail.source === "translateTool") {
244 var arrMat = eventDetail.data.value[0].properties.mat,
245 strTweenProperty = "perspective(1400) matrix3d(" + arrMat.join() + ")";
246
247 this.tweenedProperties["-webkit-transform"] = strTweenProperty;
248 this.parentComponent.parentComponent.updateKeyframeRule();
249 this.isTweenAnimated = true;
250 }
239 } 251 }
240 }, 252 },
241 253