Scrolling is now working with the new scalation/rotation code (there are still few bugs...).

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2391 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
netcrep 1997-08-22 18:38:38 +00:00
parent 127233f6f3
commit 98035d75ea
12 changed files with 514 additions and 146 deletions

View file

@ -92,25 +92,19 @@
- (void)scrollToPoint:(NSPoint)point
{
#if DEBUGLOG
NSPoint currentPoint = [self bounds].origin;
NSDebugLog (@"scrollToPoint: current point (%f, %f), point (%f, %f)",
NSLog (@"scrollToPoint: current point (%f, %f), point (%f, %f)",
currentPoint.x, currentPoint.y,
point.x, point.y);
#endif
point = [self constrainScrollPoint:point];
[super setBoundsOrigin:point];
[super setBoundsOrigin:NSMakePoint(-point.x, -point.y)];
if (_copiesOnScroll)
/* TODO: move the visible portion of the document */;
else {
NSPoint frameOrigin = [_documentView frame].origin;
NSPoint newFrameOrigin;
newFrameOrigin.x = frameOrigin.x - (point.x - currentPoint.x);
newFrameOrigin.y = frameOrigin.y - (point.y - currentPoint.y);
[_documentView setPostsFrameChangedNotifications:NO];
[_documentView setFrameOrigin:newFrameOrigin];
[_documentView setPostsFrameChangedNotifications:YES];
[self display];
[[self window] flushWindow];
}