From 30826f63ee8fc538cdbefe5439f792c009de5ee0 Mon Sep 17 00:00:00 2001 From: ericwa Date: Wed, 14 Dec 2011 18:52:42 +0000 Subject: [PATCH] * 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 --- ChangeLog | 7 ++++++- Source/NSImageCell.m | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) 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