From 0a404f6649002ec16d49c5cc60a9632a7de20d03 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sat, 18 Jan 2020 15:38:02 +0800 Subject: [PATCH] The progressive animation should not update the loop count to 1 when automatically stopped at last index. --- SDWebImage/Core/SDAnimatedImageView.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SDWebImage/Core/SDAnimatedImageView.m b/SDWebImage/Core/SDAnimatedImageView.m index efd2362d..f0b811c4 100644 --- a/SDWebImage/Core/SDAnimatedImageView.m +++ b/SDWebImage/Core/SDAnimatedImageView.m @@ -166,12 +166,13 @@ }; self.player.animationLoopHandler = ^(NSUInteger loopCount) { @strongify(self); - self.currentLoopCount = loopCount; // Progressive image reach the current last frame index. Keep the state and pause animating. Wait for later restart if (self.isProgressive) { NSUInteger lastFrameIndex = self.player.totalFrameCount - 1; [self.player seekToFrameAtIndex:lastFrameIndex loopCount:0]; [self.player pausePlaying]; + } else { + self.currentLoopCount = loopCount; } };