mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 20:00:16 +08:00
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:
@ -223,7 +223,7 @@ export class Animation extends common.Animation implements definition.Animation
|
|||||||
let value = animation.value;
|
let value = animation.value;
|
||||||
let originalValue;
|
let originalValue;
|
||||||
|
|
||||||
let tempRotate = animation.target.rotate * Math.PI / 180;
|
let tempRotate = (animation.target.rotate || 0) * Math.PI / 180;
|
||||||
let abs;
|
let abs;
|
||||||
|
|
||||||
if (valueSource === undefined) {
|
if (valueSource === undefined) {
|
||||||
@ -266,12 +266,7 @@ export class Animation extends common.Animation implements definition.Animation
|
|||||||
animation.target.style._setValue(style.rotateProperty, value, valueSource);
|
animation.target.style._setValue(style.rotateProperty, value, valueSource);
|
||||||
};
|
};
|
||||||
propertyNameToAnimate = "transform.rotation";
|
propertyNameToAnimate = "transform.rotation";
|
||||||
if (presentationLayer != null && valueSource !== dependencyObservable.ValueSource.Css) {
|
originalValue = tempRotate;
|
||||||
originalValue = presentationLayer.valueForKeyPath("transform.rotation");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
originalValue = nativeView.layer.valueForKeyPath("transform.rotation");
|
|
||||||
}
|
|
||||||
if (originalValue === 0 && animation.target.rotate !== undefined &&
|
if (originalValue === 0 && animation.target.rotate !== undefined &&
|
||||||
animation.target.rotate !== 0 && Math.floor(value / 360) - value / 360 === 0) {
|
animation.target.rotate !== 0 && Math.floor(value / 360) - value / 360 === 0) {
|
||||||
originalValue = animation.target.rotate * Math.PI / 180;
|
originalValue = animation.target.rotate * Math.PI / 180;
|
||||||
|
Reference in New Issue
Block a user