Fixed a bug with path animations on Jellybean
PointF didn't have an `equals(PointF other)` method until jb-mr2.
Prior to that, you had to use `equals(float x, float y)`. This
broke path animations which relied on that method.
This commit uses the backwards compatible `equals(float x, float y)`
method.
Fixes
@@ -37,8 +37,10 @@ class PathKeyframe extends Keyframe<PointF> {
PathKeyframe pathKeyframe = new PathKeyframe(composition, keyframe.startValue,
keyframe.endValue, keyframe.interpolator, keyframe.startFrame, keyframe.endFrame);
+ boolean equals = keyframe.endValue != null && keyframe.startValue != null &&
+ keyframe.startValue.equals(keyframe.endValue.x, keyframe.endValue.y);
//noinspection ConstantConditions
- if (keyframe.endValue != null && !keyframe.startValue.equals(keyframe.endValue)) {
+ if (pathKeyframe.endValue != null && !equals) {
pathKeyframe.path = Utils.createPath(keyframe.startValue, keyframe.endValue, cp1, cp2);
}
return pathKeyframe;
