Anti-alias downscaled screenshots in the result window

Full-res retina captures are downscaled to fit the window; nearest-neighbor
made them look chunky. Use high-quality interpolation when shrinking, keep
pixel-crisp rendering only when upscaling small selections.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4-flash-0731
This commit is contained in:
2026-08-12 16:25:23 +08:00
parent 374af50acc
commit 7bc93c2014
2 changed files with 12 additions and 8 deletions
+10 -6
View File
@@ -193,12 +193,16 @@ struct ResultView: View {
.padding(.top, 10)
if model.mode == .screenshot {
Image(nsImage: NSImage(cgImage: model.image, size: .zero))
.resizable()
.interpolation(.none)
.aspectRatio(contentMode: .fit)
.border(Color.secondary.opacity(0.4))
.padding(.horizontal, 12)
GeometryReader { geo in
let imageWidth = CGFloat(model.image.width)
Image(nsImage: NSImage(cgImage: model.image, size: .zero))
.resizable()
// Downscale with smoothing (AA); upscale keeps pixels crisp.
.interpolation(imageWidth >= geo.size.width ? .high : .none)
.aspectRatio(contentMode: .fit)
}
.border(Color.secondary.opacity(0.4))
.padding(.horizontal, 12)
} else {
ZStack(alignment: .bottomTrailing) {
ScrollView {