From b28429f940c06d161b383f09b7cc288128bd356b Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Mon, 25 Feb 2013 17:15:26 -0500 Subject: [PATCH] Fixed: window content view was not inset from the frame Previously, _CPStandardWindowView did not inset the content view rect from the window frame, thus its contents could overlap the window frame. Now the content view is correctly inset so that content view content is clipped to the window frame, except for the corners. Because the corners are round and the window frame is a background color, they can still be overlapped. this will be fixed in a later commit. Closes #1798 --- AppKit/CPWindow/_CPStandardWindowView.j | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AppKit/CPWindow/_CPStandardWindowView.j b/AppKit/CPWindow/_CPStandardWindowView.j index 6c7fef09a..3264eaca3 100644 --- a/AppKit/CPWindow/_CPStandardWindowView.j +++ b/AppKit/CPWindow/_CPStandardWindowView.j @@ -124,8 +124,17 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; + (CGRect)contentRectForFrameRect:(CGRect)aFrameRect { + /* + This is the first window view class that draws a frame. + So we have to inset the content rect to be inside the frame. + The top coordinate has already been adjusted by _CPTitleableWindowView. + */ var contentRect = [super contentRectForFrameRect:aFrameRect]; + contentRect.origin.x += 1; + contentRect.size.width -= 2; + contentRect.size.height -= 1; + // Adjust for the divider contentRect.origin.y += _CPStandardWindowViewDividerViewHeight; contentRect.size.height -= _CPStandardWindowViewDividerViewHeight;