diff --git a/ChangeLog b/ChangeLog index 8c9df88da..049ddb7ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-06-14 Eric Wasylishen + + * 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 * Source/NSImage.m: Tidy the -composite*/-dissolve* methods diff --git a/Source/NSImage.m b/Source/NSImage.m index de569ba9e..a64ad3c2d 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -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);