Fix translation of scrolling document bounds

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8042 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2000-11-06 05:00:17 +00:00
parent 5af7eddad8
commit c21aee678f
3 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2000-11-05 Adam Fedor <fedor@gnu.org>
* Source/NSScreen.m (+mainScreen): Make the mainScreen a shared
instance.
* Source/NSClipView.m (-setBoundsOrigin:): If our documentView is
focused, translate the PS context to the new bounds.
2000-11-05 Fred Kiefer <FredKiefer@gmx.de> 2000-11-05 Fred Kiefer <FredKiefer@gmx.de>
* Headers/gnustep/gui/NSClipView.h: * Headers/gnustep/gui/NSClipView.h:

View file

@ -33,6 +33,7 @@
#include <AppKit/NSColor.h> #include <AppKit/NSColor.h>
#include <AppKit/NSWindow.h> #include <AppKit/NSWindow.h>
#include <AppKit/NSGraphics.h> #include <AppKit/NSGraphics.h>
#include <AppKit/PSOperators.h>
@implementation NSClipView @implementation NSClipView
@ -213,6 +214,9 @@
[self convertRect: newBounds toView: _documentView]]; [self convertRect: newBounds toView: _documentView]];
} }
if ([NSView focusView] == _documentView)
PStranslate(NSMinX(originalBounds)-point.x, NSMinY(originalBounds)-point.y);
[_super_view reflectScrolledClipView: self]; [_super_view reflectScrolledClipView: self];
} }

View file

@ -247,11 +247,14 @@ _screenNumbers(int *count)
} }
} }
static NSScreen *mainScreen = nil;
// Creating NSScreen Instances // Creating NSScreen Instances
+ (NSScreen*) mainScreen + (NSScreen*) mainScreen
{ {
int *windows = 0, count; int *windows = 0, count;
NSScreen *mainScreen = nil; if (mainScreen)
return mainScreen;
// Initialize the window list. // Initialize the window list.
windows = _screenNumbers(&count); windows = _screenNumbers(&count);
@ -264,7 +267,7 @@ _screenNumbers(int *count)
mainScreen = [[NSScreen alloc] _initWithScreenNumber: windows[0]]; mainScreen = [[NSScreen alloc] _initWithScreenNumber: windows[0]];
NSZoneFree(NSDefaultMallocZone(), windows); // free the list NSZoneFree(NSDefaultMallocZone(), windows); // free the list
return AUTORELEASE(mainScreen); return mainScreen;
} }
+ (NSScreen*) deepestScreen + (NSScreen*) deepestScreen