Adjust for < 0 x origin.

This commit is contained in:
Brent Simmons 2018-01-21 13:10:42 -08:00
parent ca5703e14f
commit c692d357d2
1 changed files with 5 additions and 2 deletions

View File

@ -75,11 +75,14 @@ public extension NSWindow {
return return
} }
let paddingFromBottomEdge: CGFloat = 8.0 let paddingFromEdge: CGFloat = 8.0
var unflippedPoint = point var unflippedPoint = point
unflippedPoint.y = (screenFrame.maxY - point.y) - frame.height unflippedPoint.y = (screenFrame.maxY - point.y) - frame.height
if unflippedPoint.y < 0 { if unflippedPoint.y < 0 {
unflippedPoint.y = paddingFromBottomEdge unflippedPoint.y = paddingFromEdge
}
if unflippedPoint.x < 0 {
unflippedPoint.x = paddingFromEdge
} }
setFrameOrigin(unflippedPoint) setFrameOrigin(unflippedPoint)
} }