* Source/NSImageCell.m: if drawing on a view use -centerScanRect:

to pixel align the drawing rect.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34285 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2011-12-14 18:52:42 +00:00
parent c0ef7df9ed
commit 30826f63ee
2 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2011-11-17 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSImageCell.m: if drawing on a view use -centerScanRect:
to pixel align the drawing rect.
2011-12-02 German Arias <german@xelalug.org> 2011-12-02 German Arias <german@xelalug.org>
* Source/NSAlert.m (-_setupPanel): Verify if there is error * Source/NSAlert.m (-_setupPanel): Verify if there is error
@ -951,7 +956,7 @@
ivars with the non-fragile ABI. ivars with the non-fragile ABI.
2011-06-28 Eric Wasylishen <ewasylishen@gmail.com> 2011-06-28 Eric Wasylishen <ewasylishen@gmail.com>
* Headers/Additions/GNUstepGUI/GSImageMagickImageRep.h: * Headers/Additions/GNUstepGUI/GSImageMagickImageRep.h:
* Source/GNUmakefile: * Source/GNUmakefile:
* Source/NSImageRep.m: * Source/NSImageRep.m:

View file

@ -182,6 +182,7 @@ yBottomInRect(NSSize innerSize, NSRect outerRect, BOOL flipped)
NSPoint position; NSPoint position;
BOOL is_flipped = [controlView isFlipped]; BOOL is_flipped = [controlView isFlipped];
NSSize imageSize, realImageSize; NSSize imageSize, realImageSize;
NSRect rect;
NSDebugLLog(@"NSImageCell", @"NSImageCell drawInteriorWithFrame called"); NSDebugLLog(@"NSImageCell", @"NSImageCell drawInteriorWithFrame called");
@ -237,9 +238,16 @@ yBottomInRect(NSSize innerSize, NSRect outerRect, BOOL flipped)
break; break;
} }
rect = NSMakeRect(position.x, position.y,
imageSize.width, imageSize.height);
if (nil != controlView)
{
rect = [controlView centerScanRect: rect];
}
// draw! // draw!
[_cell_image drawInRect: NSMakeRect(position.x, position.y, [_cell_image drawInRect: rect
imageSize.width, imageSize.height)
fromRect: NSMakeRect(0, 0, realImageSize.width, fromRect: NSMakeRect(0, 0, realImageSize.width,
realImageSize.height) realImageSize.height)
operation: NSCompositeSourceOver operation: NSCompositeSourceOver