Bladeren bron

Fix the SDAnimatedImageView's progressive animation bug, which reset the frame index to 0 each time new frames available

DreamPiggy 6 jaren geleden
bovenliggende
commit
bfb16b27bf
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      SDWebImage/Core/SDAnimatedImageView.m

+ 1 - 1
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];
             }