Restrict scrolled rectangle to the bounds of the view

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25203 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-05-28 05:49:06 +00:00
parent 249fa82991
commit 7f736e9a2b
2 changed files with 10 additions and 3 deletions

View file

@ -2684,8 +2684,10 @@ in the main thread.
*/
- (void) scrollRect: (NSRect)aRect by: (NSSize)delta
{
NSPoint destPoint = aRect.origin;
NSPoint destPoint;
aRect = NSIntersectionRect(aRect, _bounds); // Don't copy stuff outside.
destPoint = aRect.origin;
destPoint.x -= delta.width;
destPoint.y -= delta.height;