Adjust for < 0 x origin.
This commit is contained in:
parent
ca5703e14f
commit
c692d357d2
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue