1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 23:02:35 +03:00

GH-325 Refactor slightly

This commit is contained in:
Tae Won Ha 2017-08-17 18:03:49 +02:00
parent 693552e17c
commit b01cc7fff7
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -75,14 +75,15 @@ class AppDelegateReducer {
return mainWindow
}
let refFrame = state.mainWindowTemplate.frame
let frame = refFrame.offsetBy(dx: cascadeX, dy: -cascadeY)
mainWindow.frame = frame
mainWindow.frame = self.frame(relativeTo: state.mainWindowTemplate.frame)
return mainWindow
}
fileprivate func frame(relativeTo refFrame: CGRect) -> CGRect {
return refFrame.offsetBy(dx: cascadeX, dy: -cascadeY)
}
fileprivate func screen(containing point: CGPoint) -> NSScreen? {
return NSScreen.screens()?
.reduce(nil) { (result, screen) -> NSScreen? in screen.frame.contains(point) ? screen : result }