Skip to content

Commit cf588c8

Browse files
committed
Fix the scale factor support for SDAniamtedImageInterface
1 parent 7f94bf6 commit cf588c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SDWebImageSwiftUI/Classes/SDAnimatedImageInterface.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
@protocol CALayerProtocol <NSObject>
1414
@property (nullable, strong) id contents;
15+
@property CGFloat contentsScale;
1516
@end
1617

1718
@protocol UIViewProtocol <NSObject>
@@ -159,7 +160,9 @@ - (void)startBuiltInAnimationWithImage:(UIImage<SDAnimatedImage> *)animatedImage
159160

160161
- (void)displayLayer {
161162
if (self.currentFrame) {
162-
[self _interfaceView].layer.contents = (__bridge id)self.currentFrame.CGImage;
163+
id<CALayerProtocol> layer = [self _interfaceView].layer;
164+
layer.contentsScale = self.animatedImageScale;
165+
layer.contents = (__bridge id)self.currentFrame.CGImage;
163166
}
164167
}
165168

0 commit comments

Comments
 (0)