* Source/NSImage.m: Remove unnecessary DPSgsave/DPSgrestore I added

earlier in -nativeDrawInRect:... and replace them with saving/restoring
the transformation matrix. The DPSgsave/DPSgrestore were causing problems
when drawing images with a non-rectangular clipping area.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33300 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2011-06-14 16:27:38 +00:00
parent 38d3783263
commit b31f48569c
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2011-06-14 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSImage.m: Remove unnecessary DPSgsave/DPSgrestore I added
earlier in -nativeDrawInRect:... and replace them with saving/restoring
the transformation matrix. The DPSgsave/DPSgrestore were causing problems
when drawing images with a non-rectangular clipping area.
2011-06-14 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSImage.m: Tidy the -composite*/-dissolve* methods

View file

@ -1016,7 +1016,7 @@ behavior precisely matches Cocoa. */
srcRect.origin.y * imgToCacheHeightScaleFactor,
srcRect.size.width * imgToCacheWidthScaleFactor,
srcRect.size.height * imgToCacheHeightScaleFactor);
NSAffineTransform *transform;
NSAffineTransform *transform, *backup;
cache = [[NSCachedImageRep alloc]
initWithSize: NSMakeSize(ceil(cacheSize.width), ceil(cacheSize.height))
@ -1051,7 +1051,7 @@ behavior precisely matches Cocoa. */
//NSLog(@"Draw in %@ from %@ from cache rect %@", NSStringFromRect(dstRect),
// NSStringFromRect(srcRect), NSStringFromRect(srcRectInCache));
DPSgsave(ctxt);
backup = [ctxt GSCurrentCTM];
transform = [NSAffineTransform transform];
[transform translateXBy: dstRect.origin.x yBy: dstRect.origin.y];
@ -1065,7 +1065,7 @@ behavior precisely matches Cocoa. */
operation: op
fraction: delta];
DPSgrestore(ctxt);
[ctxt GSSetCTM: backup];
[ctxt GSUndefineGState: gState];
DESTROY(cache);