Skip to content

Commit

Permalink
Fix value callback is not called for PathKeyframeAnimation (#2540)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Dorokhov <dorokhov17@yandex-team.ru>
  • Loading branch information
alex-dorokhov and Alexander Dorokhov authored Aug 28, 2024
1 parent 6ffe9bb commit 154c8f2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ public PathKeyframeAnimation(List<? extends Keyframe<PointF>> keyframes) {
@Override public PointF getValue(Keyframe<PointF> keyframe, float keyframeProgress) {
PathKeyframe pathKeyframe = (PathKeyframe) keyframe;
Path path = pathKeyframe.getPath();
if (path == null) {
return keyframe.startValue;
}

if (valueCallback != null) {
if (valueCallback != null && keyframe.endFrame != null) {
PointF value = valueCallback.getValueInternal(pathKeyframe.startFrame, pathKeyframe.endFrame,
pathKeyframe.startValue, pathKeyframe.endValue, getLinearCurrentKeyframeProgress(),
keyframeProgress, getProgress());
Expand All @@ -35,6 +32,10 @@ pathKeyframe.startValue, pathKeyframe.endValue, getLinearCurrentKeyframeProgress
}
}

if (path == null) {
return keyframe.startValue;
}

if (pathMeasureKeyframe != pathKeyframe) {
pathMeasure.setPath(path, false);
pathMeasureKeyframe = pathKeyframe;
Expand Down

0 comments on commit 154c8f2

Please sign in to comment.