mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:30:47 +00:00
Switch back to gsave/grestore.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10850 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d1b78ea7ee
commit
b6e78a559d
2 changed files with 22 additions and 21 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2001-09-06 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSView.m (-lockFocusInRect:): Switch back to gsave/grestore
|
||||||
|
syntax, use rectclip instead of rectviewclip.
|
||||||
|
(-unlockFocusWithFlush:): Likewise.
|
||||||
|
|
||||||
2001-09-03 Adam Fedor <fedor@gnu.org>
|
2001-09-03 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Source/tiff.m (NSTiffWrite): Set EXTRASAMPLES even if 0.
|
* Source/tiff.m (NSTiffWrite): Set EXTRASAMPLES even if 0.
|
||||||
|
|
|
@ -1317,7 +1317,6 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
- (void) lockFocusInRect: (NSRect)rect
|
- (void) lockFocusInRect: (NSRect)rect
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
NSAffineTransform *matrix;
|
|
||||||
struct NSWindow_struct *window_t;
|
struct NSWindow_struct *window_t;
|
||||||
NSRect wrect;
|
NSRect wrect;
|
||||||
int window_gstate;
|
int window_gstate;
|
||||||
|
@ -1336,20 +1335,8 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
window_t = (struct NSWindow_struct *)_window;
|
window_t = (struct NSWindow_struct *)_window;
|
||||||
[window_t->_rectsBeingDrawn addObject: [NSValue valueWithRect: wrect]];
|
[window_t->_rectsBeingDrawn addObject: [NSValue valueWithRect: wrect]];
|
||||||
|
|
||||||
/*
|
/* Make sure we don't modify superview's gstate */
|
||||||
* Clipping - set viewclip to the visible rectangle - which will never be
|
DPSgsave(ctxt);
|
||||||
* greater than the bounds of the view. This prevents drawing outside
|
|
||||||
* our bounds (FIXME: Perhaps IntersectRect with bounds, just to make sure?)
|
|
||||||
*/
|
|
||||||
DPSsave(ctxt);
|
|
||||||
DPSmark(ctxt); /* Rather than keep the save object, just mark it to make
|
|
||||||
sure we can find it when we unlock. We really should
|
|
||||||
keep an ivar for it, though... */
|
|
||||||
matrix = [self _matrixToWindow];
|
|
||||||
if ([matrix isRotated])
|
|
||||||
{
|
|
||||||
[matrix boundingRectFor: rect result: &rect];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_gstate)
|
if (_gstate)
|
||||||
{
|
{
|
||||||
|
@ -1360,15 +1347,24 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
}
|
}
|
||||||
_renew_gstate = 0;
|
_renew_gstate = 0;
|
||||||
DPSgsave(ctxt);
|
DPSgsave(ctxt);
|
||||||
DPSrectviewclip(ctxt, NSMinX(rect), NSMinY(rect),
|
|
||||||
NSWidth(rect), NSHeight(rect));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
NSAffineTransform *matrix;
|
||||||
|
matrix = [self _matrixToWindow];
|
||||||
|
if ([matrix isRotated])
|
||||||
|
{
|
||||||
|
[matrix boundingRectFor: rect result: &rect];
|
||||||
|
}
|
||||||
|
|
||||||
DPSsetgstate(ctxt, window_gstate);
|
DPSsetgstate(ctxt, window_gstate);
|
||||||
DPSgsave(ctxt);
|
DPSgsave(ctxt);
|
||||||
[matrix concat];
|
[matrix concat];
|
||||||
DPSrectviewclip(ctxt, NSMinX(rect), NSMinY(rect),
|
/* Clip to the visible rectangle - which will never be greater
|
||||||
|
* than the bounds of the view. This prevents drawing outside
|
||||||
|
* our bounds
|
||||||
|
*/
|
||||||
|
DPSrectclip(ctxt, NSMinX(rect), NSMinY(rect),
|
||||||
NSWidth(rect), NSHeight(rect));
|
NSWidth(rect), NSHeight(rect));
|
||||||
|
|
||||||
/* Allow subclases to make other modifications */
|
/* Allow subclases to make other modifications */
|
||||||
|
@ -1400,9 +1396,8 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
|
|
||||||
/* Restore our original gstate */
|
/* Restore our original gstate */
|
||||||
DPSgrestore(ctxt);
|
DPSgrestore(ctxt);
|
||||||
/* Restore state (including viewclip) of nesting lockFocus */
|
/* Restore state of nesting lockFocus */
|
||||||
DPScleartomark(ctxt);
|
DPSgrestore(ctxt);
|
||||||
DPSrestore(ctxt);
|
|
||||||
if (!_allocate_gstate)
|
if (!_allocate_gstate)
|
||||||
_gstate = 0;
|
_gstate = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue