mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 08:42:51 +00:00
Merge branch 'bug/4523-bad-images'
This commit is contained in:
commit
ad74aaa3da
2 files changed
+10
-10
No files matched your search
@@ -10,7 +10,10 @@
|
||||
import AppKit
|
||||
|
||||
public class RSScreen {
|
||||
public static var maxScreenScale = CGFloat(2)
|
||||
|
||||
public static var maxScreenScale: CGFloat {
|
||||
NSScreen.screens.map(\.backingScaleFactor).max() ?? 2.0
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -97,19 +97,16 @@ final class FaviconDownloader {
|
||||
}
|
||||
|
||||
func faviconAsIcon(for webFeed: WebFeed) -> IconImage? {
|
||||
|
||||
|
||||
if let image = cache[webFeed] {
|
||||
return image
|
||||
}
|
||||
|
||||
if let iconImage = favicon(for: webFeed), let imageData = iconImage.image.dataRepresentation() {
|
||||
if let scaledImage = RSImage.scaledForIcon(imageData) {
|
||||
let scaledIconImage = IconImage(scaledImage)
|
||||
cache[webFeed] = scaledIconImage
|
||||
return scaledIconImage
|
||||
}
|
||||
|
||||
if let iconImage = favicon(for: webFeed) {
|
||||
cache[webFeed] = iconImage
|
||||
return iconImage
|
||||
}
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user