diff --git a/ChangeLog b/ChangeLog index e9d7a3565..56a890a4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-10-20 Richard Frith-Macdonald + + * Source/NSClipView.m: ([-viewFrameChanged:]) fix test for when to + redraw entire area becaause document view is smaller than clipview. + Suggested by benhur@inf.UFSM.br + 2000-10-19 Michael Hanni * Source/NSTabView.m: a few bugfixes. diff --git a/Source/NSClipView.m b/Source/NSClipView.m index 37f139ec7..e724f27bf 100644 --- a/Source/NSClipView.m +++ b/Source/NSClipView.m @@ -291,19 +291,14 @@ - (void) viewFrameChanged: (NSNotification*)aNotification { - NSRect documentFrame = [_documentView frame]; - [self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]]; - /* If _bounds completely encloses (touching allowed) documentFrame */ - if ((_bounds.origin.x <= documentFrame.origin.x) - && (_bounds.origin.y <= documentFrame.origin.y) - && (_bounds.origin.x + _bounds.size.width - >= documentFrame.origin.x + documentFrame.size.width) - && (_bounds.origin.y + _bounds.size.height - >= documentFrame.origin.y + documentFrame.size.height)) + /* If document frame does not completely cover _bounds */ + if (NSContainsRect([_documentView frame], _bounds) == NO) { - /* then fill the area not covered by documentView with background color */ + /* + * fill the area not covered by documentView with background color + */ [self setNeedsDisplay: YES]; } diff --git a/Source/NSImage.m b/Source/NSImage.m index 2beb9717d..71fed9332 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -176,15 +176,18 @@ static Class cacheClass = 0; /* If there is no image with that name, search in the main bundle */ if (!nameDict || ![nameDict objectForKey: aName]) { - NSString* ext; - NSString* path = nil; - NSBundle* main_bundle; - NSArray *array; - NSString *the_name = aName; + NSString *ext; + NSString *path = nil; + NSBundle *main_bundle; + NSArray *array; + NSString *the_name = aName; + main_bundle = [NSBundle mainBundle]; - ext = [aName pathExtension]; - if (ext && [ext length] == 0) - ext = nil; + ext = [aName pathExtension]; + if (ext != nil && [ext length] == 0) + { + ext = nil; + } /* Check if extension is one of the image types */ array = [self imageFileTypes];