Merge pull request #2308 from NativeScript/raikov/fix-2177

Fixed: iOS CSS Animation rotate() do not reset the value after 360 degrees rotation
This commit is contained in:
tzraikov
2016-06-17 17:54:45 +03:00
committed by GitHub

View File

@ -223,7 +223,7 @@ export class Animation extends common.Animation implements definition.Animation
let value = animation.value;
let originalValue;
let tempRotate = animation.target.rotate * Math.PI / 180;
let tempRotate = (animation.target.rotate || 0) * Math.PI / 180;
let abs;
if (valueSource === undefined) {
@ -266,12 +266,7 @@ export class Animation extends common.Animation implements definition.Animation
animation.target.style._setValue(style.rotateProperty, value, valueSource);
};
propertyNameToAnimate = "transform.rotation";
if (presentationLayer != null && valueSource !== dependencyObservable.ValueSource.Css) {
originalValue = presentationLayer.valueForKeyPath("transform.rotation");
}
else {
originalValue = nativeView.layer.valueForKeyPath("transform.rotation");
}
originalValue = tempRotate;
if (originalValue === 0 && animation.target.rotate !== undefined &&
animation.target.rotate !== 0 && Math.floor(value / 360) - value / 360 === 0) {
originalValue = animation.target.rotate * Math.PI / 180;