Skip to content

Commit 0b0aa11

Browse files
author
Tsvetan Raikov
committed
Fixed: Animation rotates in a wrong way after 360 degrees rotation
1 parent d810a77 commit 0b0aa11

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tns-core-modules/ui/animation/animation.ios.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export class Animation extends common.Animation implements definition.Animation
223223
let value = animation.value;
224224
let originalValue;
225225

226-
let tempRotate = animation.target.rotate * Math.PI / 180;
226+
let tempRotate = (animation.target.rotate || 0) * Math.PI / 180;
227227
let abs;
228228

229229
if (valueSource === undefined) {
@@ -266,12 +266,7 @@ export class Animation extends common.Animation implements definition.Animation
266266
animation.target.style._setValue(style.rotateProperty, value, valueSource);
267267
};
268268
propertyNameToAnimate = "transform.rotation";
269-
if (presentationLayer != null && valueSource !== dependencyObservable.ValueSource.Css) {
270-
originalValue = presentationLayer.valueForKeyPath("transform.rotation");
271-
}
272-
else {
273-
originalValue = nativeView.layer.valueForKeyPath("transform.rotation");
274-
}
269+
originalValue = tempRotate;
275270
if (originalValue === 0 && animation.target.rotate !== undefined &&
276271
animation.target.rotate !== 0 && Math.floor(value / 360) - value / 360 === 0) {
277272
originalValue = animation.target.rotate * Math.PI / 180;

0 commit comments

Comments
 (0)