From fb90ee6c273905ea96d551631b6ef9adbd4aefd6 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 17 Mar 2010 13:35:22 +0000 Subject: [Author: thomasvl] Use the transforms needed to deal with Resolution Independence when sizing the window. R=avi,dmaclach DELTA=4 (3 added, 0 deleted, 1 changed) --- AppKit/GTMUILocalizerAndLayoutTweaker.h | 2 ++ AppKit/GTMUILocalizerAndLayoutTweaker.m | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'AppKit') diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.h b/AppKit/GTMUILocalizerAndLayoutTweaker.h index 4a9b666..d5b2a40 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.h +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.h @@ -79,6 +79,8 @@ // +sizeToFitFixedWidthTextField. The origin is not adjusted. For windows, // passes |NO| to for -setFrame:display:'s |displayViews| flag on the // assumptions the caller is doing all the invals/updates needed. +// NOTE: For windows, |delta| is assumed to be in content coordinates, and +// Resolution Independence transforms on the window's frame are done. + (void)resizeWindowWithoutAutoResizingSubViews:(NSWindow*)window delta:(NSSize)delta; + (void)resizeViewWithoutAutoResizingSubViews:(NSView*)view diff --git a/AppKit/GTMUILocalizerAndLayoutTweaker.m b/AppKit/GTMUILocalizerAndLayoutTweaker.m index a24eef1..4518ef1 100644 --- a/AppKit/GTMUILocalizerAndLayoutTweaker.m +++ b/AppKit/GTMUILocalizerAndLayoutTweaker.m @@ -350,9 +350,10 @@ static BOOL IsRightAnchored(NSView *view); [contentView setAutoresizesSubviews:NO]; } - NSRect rect = [window frame]; + NSRect rect = [contentView convertRect:[window frame] fromView:nil]; rect.size.width += delta.width; rect.size.height += delta.height; + rect = [contentView convertRect:rect toView:nil]; [window setFrame:rect display:NO]; // For some reason the content view is resizing, but some times not adjusting // its origin, so correct it manually. -- cgit v1.2.3