Skip to content

Commit

Permalink
move comment and add more circles
Browse files Browse the repository at this point in the history
  • Loading branch information
pablopunk committed Jun 6, 2024
1 parent ab3f3e1 commit 59c89af
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Swift Shift/src/windows/WindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class WindowManager {
static func convertYCoordinateBecauseTheAreTwoFuckingCoordinateSystems(point: NSPoint) -> NSPoint {
return NSPoint(x: point.x, y: CGDisplayBounds(CGMainDisplayID()).height - point.y)
}


static func getPosition(window: AXUIElement) -> NSPoint? {
var positionRef: CFTypeRef?
Expand All @@ -164,13 +164,16 @@ class WindowManager {

static func getWindowBounds(windowLocation: NSPoint, windowSize: CGSize) -> WindowBounds {
let windowLocationWithFixedCoordinates = WindowManager.convertYCoordinateBecauseTheAreTwoFuckingCoordinateSystems(point: windowLocation)
// drawCircleAt(x: windowLocationWithFixedCoordinates.x, y: windowLocationWithFixedCoordinates.y, diameter: 10, color: .blue)
// drawCircleAt(x: windowLocationWithFixedCoordinates.x + windowSize.width, y:windowLocationWithFixedCoordinates.y-windowSize.height, diameter: 10, color: .green)
let topLeft = NSPoint(x: windowLocationWithFixedCoordinates.x, y: windowLocationWithFixedCoordinates.y)
let topRight = NSPoint(x: windowLocationWithFixedCoordinates.x + windowSize.width, y: windowLocationWithFixedCoordinates.y)
let bottomLeft = NSPoint(x: windowLocationWithFixedCoordinates.x, y: windowLocationWithFixedCoordinates.y - windowSize.height)
let bottomRight = NSPoint(x: windowLocationWithFixedCoordinates.x + windowSize.width, y: windowLocationWithFixedCoordinates.y - windowSize.height)

// drawCircleAt(x: topLeft.x, y: topLeft.y, diameter: 10, color: .blue)
// drawCircleAt(x: topRight.x, y: topRight.y, diameter: 10, color: .blue)
// drawCircleAt(x: bottomLeft.x, y: bottomLeft.y, diameter: 10, color: .blue)
// drawCircleAt(x: bottomRight.x, y: bottomRight.y, diameter: 10, color: .blue)

return WindowBounds(topLeft: topLeft, topRight: topRight, bottomLeft: bottomLeft, bottomRight: bottomRight)
}
}
Expand Down

0 comments on commit 59c89af

Please sign in to comment.