fix: previews on multiple screens could get misplaced
This commit is contained in:
1 parent
87a2b219a5
commit
2a0a8585df
1 file changed
+3
-1
@@ -29,7 +29,9 @@ class PreviewPanel: NSPanel {
|
||||
if id != currentId {
|
||||
previewView.image = preview
|
||||
var frame = NSRect(origin: position, size: size)
|
||||
frame.origin.y = NSScreen.preferred().frame.maxY - frame.maxY
|
||||
// Flip Y coordinate from Quartz (0,0 at bottom-left) to Cocoa coordinates (0,0 at top-left)
|
||||
// Always use the primary screen as reference since all coordinates are relative to it
|
||||
frame.origin.y = NSScreen.screens.first!.frame.maxY - frame.maxY
|
||||
setFrame(frame, display: false)
|
||||
}
|
||||
if id != currentId || !isVisible {
|
||||
|
||||
Reference in new issue
Block a user