* Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Simplify a bit

bit by using
-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]
* Source/NSCell.m (-drawInteriorWithFrame:inView:): Switch from
-[NSImage compositeToPoint...] to
-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33813 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-09-07 08:18:40 +00:00
parent 19b6765e49
commit a6788023fb
3 changed files with 19 additions and 25 deletions

View file

@ -195,7 +195,6 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect, BOOL scaleUpOrDown)
NSPoint position;
BOOL is_flipped = [controlView isFlipped];
NSSize imageSize, realImageSize;
NSAffineTransform *xform = nil;
NSDebugLLog(@"NSImageCell", @"NSImageCell drawInteriorWithFrame called");
@ -277,29 +276,16 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect, BOOL scaleUpOrDown)
break;
}
// account for flipped views
if (is_flipped && controlView != nil)
{
xform = [NSAffineTransform transform];
[xform translateXBy: 0 yBy: [controlView bounds].size.height];
[xform scaleXBy: 1 yBy: -1];
[xform concat];
position.y = [controlView bounds].size.height - position.y - imageSize.height;
}
// draw!
[_cell_image drawInRect: NSMakeRect(position.x, position.y,
imageSize.width, imageSize.height)
fromRect: NSMakeRect(0, 0, realImageSize.width,
realImageSize.height)
operation: NSCompositeSourceOver
fraction: 1.0];
fraction: 1.0
respectFlipped: YES
hints: nil];
if (is_flipped && controlView != nil)
{
[xform invert];
[xform concat];
}
}
- (NSSize) cellSize