mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Use values from NSWindow to calculate the cascade offset for new windows
This commit is contained in:
@@ -251,8 +251,13 @@ static NSArray* const kObservedKeyPaths = @[ @"arrayController.arrangedObjects.p
|
||||
|
||||
- (NSRect)cascadedWindowFrame
|
||||
{
|
||||
NSRect r = [self windowFrame];
|
||||
return { { NSMinX(r) + 21, NSMinY(r) - 23 }, r.size };
|
||||
NSRect frameRect = [self windowFrame];
|
||||
NSRect contentRect = [NSWindow contentRectForFrameRect:frameRect styleMask:self.window.styleMask];
|
||||
|
||||
CGFloat offset = NSMaxY(frameRect) - NSMaxY(contentRect);
|
||||
frameRect.origin.y -= offset;
|
||||
frameRect.origin.x += offset;
|
||||
return frameRect;
|
||||
}
|
||||
|
||||
- (NSRect)frameRectForNewWindow
|
||||
|
||||
Reference in New Issue
Block a user