mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fixed broken unit tests because of the animation refactoring
This commit is contained in:
@@ -170,7 +170,7 @@ export class Animation extends common.Animation implements definition.Animation
|
|||||||
case common.Properties.backgroundColor:
|
case common.Properties.backgroundColor:
|
||||||
(<any>animation)._originalValue = animation.target.backgroundColor;
|
(<any>animation)._originalValue = animation.target.backgroundColor;
|
||||||
(<any>animation)._propertyResetCallback = (value) => { animation.target.backgroundColor = value };
|
(<any>animation)._propertyResetCallback = (value) => { animation.target.backgroundColor = value };
|
||||||
originalValue = nativeView.layer.backgroundColor.CGColor;
|
originalValue = nativeView.layer.backgroundColor;
|
||||||
value = value.CGColor;
|
value = value.CGColor;
|
||||||
break;
|
break;
|
||||||
case common.Properties.opacity:
|
case common.Properties.opacity:
|
||||||
@@ -351,3 +351,19 @@ export class Animation extends common.Animation implements definition.Animation
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function _getTransformMismatchErrorMessage(view: viewModule.View): string {
|
||||||
|
// Order is important: translate, rotate, scale
|
||||||
|
var result: CGAffineTransform = CGAffineTransformIdentity;
|
||||||
|
result = CGAffineTransformTranslate(result, view.translateX, view.translateY);
|
||||||
|
result = CGAffineTransformRotate(result, view.rotate * Math.PI / 180);
|
||||||
|
result = CGAffineTransformScale(result, view.scaleX, view.scaleY);
|
||||||
|
var viewTransform = NSStringFromCGAffineTransform(result);
|
||||||
|
var nativeTransform = NSStringFromCGAffineTransform(view._nativeView.transform);
|
||||||
|
|
||||||
|
if (viewTransform !== nativeTransform) {
|
||||||
|
return "View and Native transforms do not match. View: " + viewTransform + "; Native: " + nativeTransform;
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user