diff --git a/ChangeLog b/ChangeLog index 674244f1b..ee49d996e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Oct 16 12:28:00 1997 Scott Christley + + * config.mak.in: Delete. + * Headers/gnustep/gui/NSScrollView.h: Correct datatype. + * Headers/gnustep/gui/NSWindow.h: Declare NSMutableArray. + * Source/NSMenu.m (-drawRect:): Handle rounding errors. + * Source/NSScrollView.m: Correct datatype. + Mon Oct 13 16:17:45 1997 Ovidiu Predescu * Source/NSMatrix.m: Removed commented out portions of code. diff --git a/Headers/gnustep/gui/NSScrollView.h b/Headers/gnustep/gui/NSScrollView.h index 3c2ce320f..5d62ddf55 100644 --- a/Headers/gnustep/gui/NSScrollView.h +++ b/Headers/gnustep/gui/NSScrollView.h @@ -77,8 +77,8 @@ - (NSBorderType)borderType; /* Managing the scrolled views */ -- (void)setContentView:(NSClipView*)aView; -- (NSClipView*)contentView; +- (void)setContentView:(NSView*)aView; +- (NSView*)contentView; - (void)setDocumentView:(NSView*)aView; - (id)documentView; - (void)setDocumentCursor:(NSCursor*)aCursor; diff --git a/Headers/gnustep/gui/NSWindow.h b/Headers/gnustep/gui/NSWindow.h index a5ff0b348..25167fdae 100644 --- a/Headers/gnustep/gui/NSWindow.h +++ b/Headers/gnustep/gui/NSWindow.h @@ -36,6 +36,7 @@ @class NSString; @class NSArray; +@class NSMutableArray; @class NSData; @class NSDictionary; @class NSNotification; diff --git a/Source/NSMenu.m b/Source/NSMenu.m index d189b51d1..c1c95858e 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -37,6 +37,7 @@ #include #include #include +#include #define ASSIGN(variable, value) \ [value retain]; \ @@ -207,12 +208,15 @@ static NSFont* menuFont = nil; int max, howMany; NSRect intRect = {{0, 0}, {0, 0}}; - max = count - rect.origin.y / (cellSize.height + INTERCELL_SPACE); - howMany = rect.size.height / (cellSize.height + INTERCELL_SPACE); + // If there are no cells then just return + if (count == 0) return; + + max = ceil((float)count - rect.origin.y / (cellSize.height + INTERCELL_SPACE)); + howMany = ceil(rect.size.height / (cellSize.height + INTERCELL_SPACE)); intRect.origin.y = (count - max) * (cellSize.height + INTERCELL_SPACE); intRect.size = cellSize; - for (i = max - 1; howMany >= 0; i--, howMany--) { + for (i = max - 1; howMany > 0; i--, howMany--) { id aCell = [cells objectAtIndex:i]; [aCell drawWithFrame:intRect inView:self]; diff --git a/Source/NSScrollView.m b/Source/NSScrollView.m index 76ac30b61..0c0ff2938 100644 --- a/Source/NSScrollView.m +++ b/Source/NSScrollView.m @@ -117,7 +117,7 @@ static Class rulerViewClass = nil; [super dealloc]; } -- (void)setContentView:(NSClipView*)aView +- (void)setContentView:(NSView*)aView { ASSIGN(_contentView, aView); [self addSubview:_contentView]; @@ -407,7 +407,7 @@ static Class rulerViewClass = nil; - (BOOL)hasVerticalScroller { return _hasVertScroller; } - (BOOL)hasHorizontalRuler { return _hasHorizRuler; } - (NSSize)contentSize { return [_contentView bounds].size; } -- (NSClipView*)contentView { return _contentView; } +- (NSView*)contentView { return _contentView; } - (NSRulerView*)horizontalRulerView { return _horizRuler; } - (BOOL)hasVerticalRuler { return _hasVertRuler; } - (NSRulerView*)verticalRulerView { return _vertRuler; }