Skip to content

Commit

Permalink
Fix multi-monitor issue for all possible monitor arrangements
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanrhu committed Nov 13, 2024
1 parent 5a7f72c commit 0421698
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions MacsyZones/LayoutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,20 @@ class LayoutWindow {

let width = sectionWindow.editorWindow.frame.size.width
let height = sectionWindow.editorWindow.frame.size.height
let x = sectionWindow.editorWindow.frame.origin.x
let y = sectionWindow.editorWindow.frame.origin.y

var x: CGFloat
let y: CGFloat

if let screen = sectionWindow.editorWindow.screen {
let windowFrame = sectionWindow.editorWindow.frame
let screenFrame = screen.frame

x = windowFrame.origin.x - screenFrame.origin.x
y = windowFrame.origin.y - screenFrame.origin.y
} else {
x = sectionWindow.editorWindow.frame.origin.x
y = sectionWindow.editorWindow.frame.origin.y
}

sectionConfig.heightPercentage = height / screenSize.height
sectionConfig.widthPercentage = width / screenSize.width
Expand Down

0 comments on commit 0421698

Please sign in to comment.