From 31694e8ec84cc8df0d2640993359d5e7da9ca88e Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 28 May 2007 05:49:06 +0000 Subject: [PATCH] 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 --- ChangeLog | 9 +++++++-- Source/NSView.m | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b4c6137f..f0af0200a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-28 Richard Frith-Macdonald + + * Source/NSView.m: ([scrollRect:by:]) restrict scrolled rectangle to + the bounds of the view. + 2007-05-23 Fred Kiefer * Source/NSPrintOperation.m @@ -5,11 +10,11 @@ -_printOperationDidRun:returnCode:contextInfo:) Only set and use GSModalRunDelegate and GSModalRunSelector values when not nil. -2007-05-17 Riccardo Frith-Macdonald +2007-05-17 Richard Frith-Macdonald * Source/NSFont.m: Revert incorrect matrix equality test change. -2007-05-16 Riccardo Frith-Macdonald +2007-05-16 Richard Frith-Macdonald * Headers/AppKit/NSFontDescriptor.h: tidied indentation etc. * Source/NSFont.m: Tidied for coding standards. Fixed memory leak. diff --git a/Source/NSView.m b/Source/NSView.m index 9dfd6dd16..aab607b8e 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -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;