diff --git a/ChangeLog b/ChangeLog index a9a7109ee..65df93a26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-17 Eric Wasylishen + + * Source/NSImageCell.m: if drawing on a view use -centerScanRect: + to pixel align the drawing rect. + 2011-12-02 German Arias * Source/NSAlert.m (-_setupPanel): Verify if there is error @@ -951,7 +956,7 @@ ivars with the non-fragile ABI. 2011-06-28 Eric Wasylishen - + * Headers/Additions/GNUstepGUI/GSImageMagickImageRep.h: * Source/GNUmakefile: * Source/NSImageRep.m: diff --git a/Source/NSImageCell.m b/Source/NSImageCell.m index 46a9784fa..d1d7d9824 100644 --- a/Source/NSImageCell.m +++ b/Source/NSImageCell.m @@ -182,6 +182,7 @@ yBottomInRect(NSSize innerSize, NSRect outerRect, BOOL flipped) NSPoint position; BOOL is_flipped = [controlView isFlipped]; NSSize imageSize, realImageSize; + NSRect rect; NSDebugLLog(@"NSImageCell", @"NSImageCell drawInteriorWithFrame called"); @@ -237,9 +238,16 @@ yBottomInRect(NSSize innerSize, NSRect outerRect, BOOL flipped) break; } + rect = NSMakeRect(position.x, position.y, + imageSize.width, imageSize.height); + + if (nil != controlView) + { + rect = [controlView centerScanRect: rect]; + } + // draw! - [_cell_image drawInRect: NSMakeRect(position.x, position.y, - imageSize.width, imageSize.height) + [_cell_image drawInRect: rect fromRect: NSMakeRect(0, 0, realImageSize.width, realImageSize.height) operation: NSCompositeSourceOver