diff --git a/ChangeLog b/ChangeLog index d8db90010..62e88aba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-06-13 Eric Wasylishen + + * Source/NSView.m (-scrollRectToVisible:): Work when the receiver + isn't partially visible in the clip view. + 2011-06-13 Eric Wasylishen * Source/NSImage.m: Completely overhaul the best rep selection. diff --git a/Source/NSView.m b/Source/NSView.m index d876830eb..ebe6e9263 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -3075,7 +3075,7 @@ Returns YES iff any scrolling was done. if (s != nil) { - NSRect vRect = [self visibleRect]; + NSRect vRect = [s documentVisibleRect]; NSPoint aPoint = vRect.origin; // Ok we assume that the rectangle is origined at the bottom left // and goes to the top and right as it grows in size for the naming @@ -3085,6 +3085,8 @@ Returns YES iff any scrolling was done. if (vRect.size.width == 0 && vRect.size.height == 0) return NO; + aRect = [self convertRect: aRect toView: [s documentView]]; + // Find the differences on each side. ldiff = NSMinX(vRect) - NSMinX(aRect); rdiff = NSMaxX(aRect) - NSMaxX(vRect); @@ -3101,7 +3103,7 @@ Returns YES iff any scrolling was done. if (aPoint.x != vRect.origin.x || aPoint.y != vRect.origin.y) { - aPoint = [self convertPoint: aPoint toView: s]; + aPoint = [[s documentView] convertPoint: aPoint toView: s]; [s scrollToPoint: aPoint]; return YES; }