* 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

@ -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