From dba0b61156cba83e5edf4ac8b54fea02710074f2 Mon Sep 17 00:00:00 2001 From: far Date: Thu, 3 Dec 1998 21:23:58 +0000 Subject: [PATCH] * NSView.m resizeSubviewsWithOldSize: check whether view has ever been rotated (per 4.2 docs). * NSStringDrawing.m sizeWithAttributes: fix minor bug introduced while optimizing tab calc. * NSCell.m: drawInteriorWithFrame: minor optimization git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3379 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 ++++++++ Source/NSApplication.m | 6 ++++-- Source/NSCell.m | 2 +- Source/NSImage.m | 1 + Source/NSStringDrawing.m | 7 +++++-- Source/NSView.m | 28 ++++++++++++++-------------- 6 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92b6a2f68..4e9f3d0a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Dec 3 1998 Felipe A. Rodriguez + + * NSView.m resizeSubviewsWithOldSize: check whether view has ever been + rotated (per 4.2 docs). + * NSStringDrawing.m sizeWithAttributes: fix minor bug introduced while + optimizing tab calc. + * NSCell.m: drawInteriorWithFrame: minor optimization + Tue Dec 3 7:00:00 1998 Richard Frith-Macdonald * NSApplication.m: Fixed include for GNUServicesManager.h diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 6376783c9..50117f6c8 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -871,7 +871,8 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; // Tell the windows to hide for (i = 0, count = [window_list count]; i < count; i++) - [[window_list objectAtIndex:i] performHide:sender]; +// [[window_list objectAtIndex:i] performHide:sender]; + [[window_list objectAtIndex:i] orderOut:sender]; app_is_hidden = YES; // notify that we did hide @@ -889,7 +890,8 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; int i, count; // Tell windows to unhide for (i = 0, count = [window_list count]; i < count; i++) - [[window_list objectAtIndex:i] performUnhide:sender]; +// [[window_list objectAtIndex:i] performUnhide:sender]; + [[window_list objectAtIndex:i] orderFront:sender]; // TODO: unhide the menu diff --git a/Source/NSCell.m b/Source/NSCell.m index d850cf491..d077b2102 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -463,7 +463,7 @@ NSString* _string; break; } case NSImageCellType: - [self _displayImage:[self image] inFrame:cellFrame]; + [self _displayImage:cell_image inFrame:cellFrame]; break; case NSNullCellType: break; diff --git a/Source/NSImage.m b/Source/NSImage.m index b795af942..41541c2c2 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -238,6 +238,7 @@ static NSDictionary* nsmapping = nil; { NSImage* image = [[[NSImage alloc] initByReferencingFile:path] autorelease]; + if (image) [image setName: [[path lastPathComponent] stringByDeletingPathExtension]]; diff --git a/Source/NSStringDrawing.m b/Source/NSStringDrawing.m index 3c828dff4..7a024c55f 100644 --- a/Source/NSStringDrawing.m +++ b/Source/NSStringDrawing.m @@ -41,6 +41,7 @@ NSFont *font; const char *str = [self cString]; int i = 0, j = TABWIDTH; static float tabSize; +float tabSumSize; static float pointSize; static NSFont *lastFont = nil; @@ -60,12 +61,14 @@ static NSFont *lastFont = nil; if(font != lastFont) // update font info { // if font changes - tabSize = (float)i * [font widthOfString:@"\t"]; + tabSize = [font widthOfString:@"\t"]; lastFont = font; pointSize = [font pointSize]; } + + tabSumSize = (float)i * tabSize; - return NSMakeSize(([font widthOfString:self] + tabSize), pointSize); + return NSMakeSize(([font widthOfString:self] + tabSumSize), pointSize); } @end diff --git a/Source/NSView.m b/Source/NSView.m index 1f6bd85b0..363d9b01f 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -611,12 +611,12 @@ PSMatrix* matrix; post_bounds_changes = flag; } -- (void)resizeSubviewsWithOldSize:(NSSize)oldSize -{ -id e, o; - - if (![self autoresizesSubviews]) // Are we suppose to - return; // resize our subviews? +- (void)resizeSubviewsWithOldSize:(NSSize)oldSize // resize subviews only +{ // if we are supposed +id e, o; // to and we have never + // been rotated + if (![self autoresizesSubviews] && !is_rotated_from_base) + return; e = [sub_views objectEnumerator]; o = [e nextObject]; @@ -719,13 +719,13 @@ id e, o; } - (void)displayIfNeededInRectIgnoringOpacity:(NSRect)aRect -{ // of our sub views if -int i = 0, count; // any part of self has - // been marked to be in - for (count = [sub_views count]; i < count; ++i) // need of display with - { // setNeedsDisplay or - NSView* subview = [sub_views objectAtIndex:i]; // stNeedsDisplayInRect - +{ // display self and all +int i = 0, count; // of our sub views if + // any part of self has + for (count = [sub_views count]; i < count; ++i) // been marked to be in + { // need of display with + NSView* subview = [sub_views objectAtIndex:i]; // setNeedsDisplay or + // stNeedsDisplayInRect if(subview->needs_display) { NSRect rect = subview->invalidatedRectangle; @@ -1097,7 +1097,7 @@ TrackingRectangle *m; } - (void)dragImage:(NSImage *)anImage // initiate a dragging - at:(NSPoint)viewLocation // session + at:(NSPoint)viewLocation // session (backend) offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard