* 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
This commit is contained in:
far 1998-12-03 21:23:58 +00:00
parent 00560ea975
commit dba0b61156
6 changed files with 33 additions and 19 deletions

View file

@ -1,3 +1,11 @@
Thu Dec 3 1998 Felipe A. Rodriguez <far@ix.netcom.com>
* 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 <richard@brainstorm.co.uk> Tue Dec 3 7:00:00 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* NSApplication.m: Fixed include for GNUServicesManager.h * NSApplication.m: Fixed include for GNUServicesManager.h

View file

@ -871,7 +871,8 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
// Tell the windows to hide // Tell the windows to hide
for (i = 0, count = [window_list count]; i < count; i++) 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; app_is_hidden = YES;
// notify that we did hide // notify that we did hide
@ -889,7 +890,8 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
int i, count; int i, count;
// Tell windows to unhide // Tell windows to unhide
for (i = 0, count = [window_list count]; i < count; i++) 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 // TODO: unhide the menu

View file

@ -463,7 +463,7 @@ NSString* _string;
break; break;
} }
case NSImageCellType: case NSImageCellType:
[self _displayImage:[self image] inFrame:cellFrame]; [self _displayImage:cell_image inFrame:cellFrame];
break; break;
case NSNullCellType: case NSNullCellType:
break; break;

View file

@ -238,6 +238,7 @@ static NSDictionary* nsmapping = nil;
{ {
NSImage* image = [[[NSImage alloc] initByReferencingFile:path] NSImage* image = [[[NSImage alloc] initByReferencingFile:path]
autorelease]; autorelease];
if (image) if (image)
[image setName: [[path lastPathComponent] [image setName: [[path lastPathComponent]
stringByDeletingPathExtension]]; stringByDeletingPathExtension]];

View file

@ -41,6 +41,7 @@ NSFont *font;
const char *str = [self cString]; const char *str = [self cString];
int i = 0, j = TABWIDTH; int i = 0, j = TABWIDTH;
static float tabSize; static float tabSize;
float tabSumSize;
static float pointSize; static float pointSize;
static NSFont *lastFont = nil; static NSFont *lastFont = nil;
@ -60,12 +61,14 @@ static NSFont *lastFont = nil;
if(font != lastFont) // update font info if(font != lastFont) // update font info
{ // if font changes { // if font changes
tabSize = (float)i * [font widthOfString:@"\t"]; tabSize = [font widthOfString:@"\t"];
lastFont = font; lastFont = font;
pointSize = [font pointSize]; pointSize = [font pointSize];
} }
return NSMakeSize(([font widthOfString:self] + tabSize), pointSize); tabSumSize = (float)i * tabSize;
return NSMakeSize(([font widthOfString:self] + tabSumSize), pointSize);
} }
@end @end

View file

@ -611,12 +611,12 @@ PSMatrix* matrix;
post_bounds_changes = flag; post_bounds_changes = flag;
} }
- (void)resizeSubviewsWithOldSize:(NSSize)oldSize - (void)resizeSubviewsWithOldSize:(NSSize)oldSize // resize subviews only
{ { // if we are supposed
id e, o; id e, o; // to and we have never
// been rotated
if (![self autoresizesSubviews]) // Are we suppose to if (![self autoresizesSubviews] && !is_rotated_from_base)
return; // resize our subviews? return;
e = [sub_views objectEnumerator]; e = [sub_views objectEnumerator];
o = [e nextObject]; o = [e nextObject];
@ -719,13 +719,13 @@ id e, o;
} }
- (void)displayIfNeededInRectIgnoringOpacity:(NSRect)aRect - (void)displayIfNeededInRectIgnoringOpacity:(NSRect)aRect
{ // of our sub views if { // display self and all
int i = 0, count; // any part of self has int i = 0, count; // of our sub views if
// been marked to be in // any part of self has
for (count = [sub_views count]; i < count; ++i) // need of display with for (count = [sub_views count]; i < count; ++i) // been marked to be in
{ // setNeedsDisplay or { // need of display with
NSView* subview = [sub_views objectAtIndex:i]; // stNeedsDisplayInRect NSView* subview = [sub_views objectAtIndex:i]; // setNeedsDisplay or
// stNeedsDisplayInRect
if(subview->needs_display) if(subview->needs_display)
{ {
NSRect rect = subview->invalidatedRectangle; NSRect rect = subview->invalidatedRectangle;
@ -1097,7 +1097,7 @@ TrackingRectangle *m;
} }
- (void)dragImage:(NSImage *)anImage // initiate a dragging - (void)dragImage:(NSImage *)anImage // initiate a dragging
at:(NSPoint)viewLocation // session at:(NSPoint)viewLocation // session (backend)
offset:(NSSize)initialOffset offset:(NSSize)initialOffset
event:(NSEvent *)event event:(NSEvent *)event
pasteboard:(NSPasteboard *)pboard pasteboard:(NSPasteboard *)pboard