From aa89511c74a59de87889260717357996c2147743 Mon Sep 17 00:00:00 2001 From: Insomnia Date: Wed, 28 Oct 2020 18:13:00 +0800 Subject: [PATCH] sync --- SDWebImage/Core/SDAnimatedImagePlayer.m | 6 ++---- SDWebImage/Core/SDAnimatedImageView.m | 11 +++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/SDWebImage/Core/SDAnimatedImagePlayer.m b/SDWebImage/Core/SDAnimatedImagePlayer.m index 0c240239..d422d3f4 100644 --- a/SDWebImage/Core/SDAnimatedImagePlayer.m +++ b/SDWebImage/Core/SDAnimatedImagePlayer.m @@ -140,9 +140,7 @@ #pragma mark - State Control - (void)setupCurrentFrame { - if (self.playbackMode == SDAnimatedImagePlaybackModeReversedBounce) { - self.currentFrameIndex = self.totalFrameCount - 1; - } + if (self.playbackMode == ) if ([self.animatedProvider isKindOfClass:[UIImage class]]) { UIImage *image = (UIImage *)self.animatedProvider; @@ -183,7 +181,7 @@ - (void)startPlaying { [self.displayLink start]; // Setup frame - [self setupCurrentFrame]; + [self setupCurrentFrame]; // Calculate max buffer size [self calculateMaxBufferCount]; } diff --git a/SDWebImage/Core/SDAnimatedImageView.m b/SDWebImage/Core/SDAnimatedImageView.m index a8c7549a..d65a1054 100644 --- a/SDWebImage/Core/SDAnimatedImageView.m +++ b/SDWebImage/Core/SDAnimatedImageView.m @@ -23,6 +23,7 @@ NSRunLoopMode _runLoopMode; NSUInteger _maxBufferSize; double _playbackRate; + SDAnimatedImagePlaybackMode _playbackMode; } @property (nonatomic, strong, readwrite) UIImage *currentFrame; @@ -241,6 +242,16 @@ return _playbackRate; } +- (void)setPlaybackMode:(SDAnimatedImagePlaybackMode)playbackMode { + _playbackMode = playbackMode; + self.player.playbackMode = playbackMode; +} + +- (SDAnimatedImagePlaybackMode)playbackMode { + return _playbackMode; +} + + - (BOOL)shouldIncrementalLoad { if (!_initFinished) {