From bfb16b27bfefd37b77ccac4922253200ca89fbff Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sat, 18 Jan 2020 14:58:52 +0800 Subject: [PATCH] Fix the SDAnimatedImageView's progressive animation bug, which reset the frame index to 0 each time new frames available --- SDWebImage/Core/SDAnimatedImageView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDWebImage/Core/SDAnimatedImageView.m b/SDWebImage/Core/SDAnimatedImageView.m index 78f1cb8b..efd2362d 100644 --- a/SDWebImage/Core/SDAnimatedImageView.m +++ b/SDWebImage/Core/SDAnimatedImageView.m @@ -169,7 +169,7 @@ 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; + NSUInteger lastFrameIndex = self.player.totalFrameCount - 1; [self.player seekToFrameAtIndex:lastFrameIndex loopCount:0]; [self.player pausePlaying]; }