mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
* Source/NSView.m (-scrollRectToVisible:): Work when the receiver
isn't partially visible in the clip view. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33297 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d29ec43ebd
commit
1a25ffa41e
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-06-13 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSView.m (-scrollRectToVisible:): Work when the receiver
|
||||
isn't partially visible in the clip view.
|
||||
|
||||
2011-06-13 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSImage.m: Completely overhaul the best rep selection.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue