From 07fb8d7d83c232b87def396f2d2ab0353a18bea9 Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 28 Jan 2001 03:11:57 +0000 Subject: [PATCH] Fixed replacing a non-flipped document view (such as nil) with a flipped one (such as a matrix) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8844 72102866-910b-0410-8b05-ffd578937521 --- Source/NSClipView.m | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/NSClipView.m b/Source/NSClipView.m index 846809ce1..8253fdd6f 100644 --- a/Source/NSClipView.m +++ b/Source/NSClipView.m @@ -61,8 +61,10 @@ NSNotificationCenter *nc; if (_documentView == aView) - return; - + { + return; + } + nc = [NSNotificationCenter defaultCenter]; if (_documentView) { @@ -72,15 +74,16 @@ ASSIGN (_documentView, aView); + /* Call this before doing anything else ! */ + _rFlags.flipped_view = [self isFlipped]; + [self _invalidateCoordinates]; + if (_documentView) { NSRect df; [self addSubview: _documentView]; - /* Call this before setting bounds origin ! */ - _rFlags.flipped_view = [self isFlipped]; - df = [_documentView frame]; [self setBoundsOrigin: df.origin]; @@ -108,8 +111,6 @@ object: _documentView]; } - _rFlags.flipped_view = [self isFlipped]; - /* TODO: Adjust the key view loop to include the new document view */ [_super_view reflectScrolledClipView: self]; @@ -181,7 +182,10 @@ destPoint.x -= dx; destPoint.y -= dy; [self lockFocus]; + + /* FIXME! copy only an integral rect in device space */ NSCopyBits (0, intersection, destPoint); + [self unlockFocus]; /* Change coordinate system to the new one */