fix: thumbnails might be shown too small

This commit is contained in:
lwouis committed 2026-03-12 11:24:47 +01:00
1 parent 17615d00a9
commit 57c95a6e35
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@ class Window {
if let position, let size,
let view = (TilesView.recycledViews.first { $0.window_?.cgWindowId == cgWindowId }) {
if !view.thumbnail.isHidden {
let thumbnailSize = TileView.thumbnailSize(screenshot.size(), false)
let thumbnailSize = TileView.thumbnailSize(size, false)
let newSize = thumbnailSize.width != view.thumbnail.frame.width || thumbnailSize.height != view.thumbnail.frame.height
view.thumbnail.updateContents(screenshot, thumbnailSize)
// if the thumbnail size has changed, we need to refresh the open UI
+1 -1
View File
@@ -271,7 +271,7 @@ extension SCStreamConfiguration {
// capture screenshots as small as needed for the thumbnails
let maxSize = TilesPanel.maxPossibleThumbnailSize
guard maxSize.width > 0, maxSize.height > 0 else { return }
let scale = min(maxSize.width / originalSize.width, maxSize.height / originalSize.height)
let scale = min(1.0, maxSize.width / originalSize.width, maxSize.height / originalSize.height)
width = Int((originalSize.width * scale).rounded())
height = Int((originalSize.height * scale).rounded())
}