Skip to content

Commit d7e80bc

Browse files
committed
Update the comments about .scaleProportionallyUpOrDown on macOS
1 parent 2d07004 commit d7e80bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SDWebImageSwiftUI/Classes/AnimatedImage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ public struct AnimatedImage : PlatformViewRepresentable {
290290
switch imageLayout.contentMode {
291291
case .fill:
292292
#if os(macOS)
293-
// Actually, NSImageView have no `.aspectFill` unlike UIImageView, only `CALayerContentsGravity.resizeAspectFill` have the same concept, but it does not work here
294-
// TODO: Need SwiftUI officialy provide a solution
293+
// Actually, NSImageView have no `.aspectFill` unlike UIImageView, only `CALayerContentsGravity.resizeAspectFill` have the same concept
294+
// However, using `.scaleProportionallyUpOrDown`, SwiftUI still layout the HostingView correctly, so this is OK
295295
contentMode = .scaleProportionallyUpOrDown
296296
#elseif os(iOS) || os(tvOS)
297297
contentMode = .scaleAspectFill

0 commit comments

Comments
 (0)