|
105 | 105 | animation.rotate = new Scene($this, rotateOptions, 360);
|
106 | 106 | }
|
107 | 107 | if (animation.x || animation.y || animation.z || animation.scale || animation.rotate) {
|
108 |
| - animation.transform = new Transform(new TransformMatrix()); |
| 108 | + animation.transform = true; |
109 | 109 | }
|
110 | 110 |
|
111 | 111 | if (typeof options.color != "undefined") {
|
|
159 | 159 | for (var i=0, len=animations.length; i<len; i++) {
|
160 | 160 | animation = animations[i];
|
161 | 161 | if (animation.transform) {
|
162 |
| - TransformMatrix.fromStyle(style, animation.transform.matrix); |
| 162 | + animation.transform = new Transform(TransformMatrix.fromStyle(style)); |
163 | 163 | if (animation.x && animation.x.needsUpdate()) {
|
164 | 164 | var newX = animation.x.getValue(animation.transform.matrix.getTranslateX());
|
165 | 165 | animation.transform.setTranslateX(newX);
|
|
180 | 180 | var newRotation = animation.rotate.getValue(animation.transform.matrix.getRotation());
|
181 | 181 | animation.transform.setRotation(newRotation);
|
182 | 182 | }
|
183 |
| - var transform = animation.transform.toString(); |
184 |
| - this.style['-webkit-transform'] = transform; |
185 |
| - this.style['-moz-transform'] = transform; |
186 |
| - this.style['-ms-transform'] = transform; |
187 |
| - this.style['-o-transform'] = transform; |
188 |
| - this.style.transform = transform; |
| 183 | + if (animation.transform.isSet()) { |
| 184 | + var transform = animation.transform.toString(); |
| 185 | + this.style['-webkit-transform'] = transform; |
| 186 | + this.style['-moz-transform'] = transform; |
| 187 | + this.style['-ms-transform'] = transform; |
| 188 | + this.style['-o-transform'] = transform; |
| 189 | + this.style.transform = transform; |
| 190 | + } |
189 | 191 | }
|
190 | 192 | if (animation.color && animation.color.needsUpdate()) {
|
191 | 193 | var fromColor = RGBColor.fromString(animation.color.getFrom(style.color)),
|
|
500 | 502 | setRotation: function(angle) {
|
501 | 503 | this.rotate = angle;
|
502 | 504 | },
|
| 505 | + isSet: function() { |
| 506 | + return (typeof this.translateX != "undefined" || |
| 507 | + typeof this.translateY != "undefined" || |
| 508 | + typeof this.translateZ != "undefined" || |
| 509 | + typeof this.scale != "undefined" || |
| 510 | + typeof this.rotate != "undefined") |
| 511 | + }, |
503 | 512 | toString: function() {
|
504 | 513 | var x = (typeof this.translateX != "undefined" ? this.translateX : this.matrix.getTranslateX()).toFixed(2),
|
505 | 514 | y = (typeof this.translateY != "undefined" ? this.translateY : this.matrix.getTranslateY()).toFixed(2),
|
|
0 commit comments