mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 09:50:16 +00:00
Fix rendering bug with some favicons. Use proper scaling factor and avoid converting to TIFF.
This commit is contained in:
1 parent
0c83ce21ef
commit
cbbd2c3f4b
2 files changed
+9
-7
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
|
||||
|
||||
@@ -102,12 +102,11 @@ final class FaviconDownloader {
|
||||
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) {
|
||||
// Skip the data conversion roundtrip that can introduce artifacts
|
||||
// Use the original image directly for better quality
|
||||
cache[webFeed] = iconImage
|
||||
return iconImage
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user