mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 07:28:37 +00:00
macos: restrict resizing based on sliding terminal position
This commit is contained in:
@@ -35,6 +35,17 @@ enum SlideTerminalPosition {
|
||||
}
|
||||
}
|
||||
|
||||
/// Restrict the frame size during resizing.
|
||||
func restrictFrameSize(_ size: NSSize, on screen: NSScreen) -> NSSize {
|
||||
var finalSize = size
|
||||
switch (self) {
|
||||
case .top:
|
||||
finalSize.width = screen.frame.width
|
||||
}
|
||||
|
||||
return finalSize
|
||||
}
|
||||
|
||||
/// The initial point origin for this position.
|
||||
func initialOrigin(for window: NSWindow, on screen: NSScreen) -> CGPoint {
|
||||
switch (self) {
|
||||
|
Reference in New Issue
Block a user