git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4870 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-09-11 05:48:20 +00:00
parent 63b1e96172
commit c112f1be56
2 changed files with 19 additions and 7 deletions

View file

@ -312,8 +312,20 @@ static Class colorClass;
if (image)
{
NSSize size;
NSPoint position;
[image setBackgroundColor: backColor];
[self _drawImage: image inFrame: image_rect];
size = [image size];
position.x = MAX(NSMidX(cellFrame) - (size.width/2.),0.);
position.y = MAX(NSMidY(cellFrame) - (size.height/2.),0.);
/*
* Images are always drawn with their bottom-left corner at the origin
* so we must adjust the position to take account of a flipped view.
*/
if ([control_view isFlipped])
position.y += size.height;
[image compositeToPoint: position operation: NSCompositeCopy];
}
}

View file

@ -176,11 +176,11 @@ static Class cellClass;
// Get border size
if (cell_bordered)
borderSize = [callClass sizeForBorderType: NSLineBorder];
borderSize = [cellClass sizeForBorderType: NSLineBorder];
else if (cell_bezeled)
borderSize = [callClass sizeForBorderType: NSBezelBorder];
borderSize = [cellClass sizeForBorderType: NSBezelBorder];
else
borderSize = [callClass sizeForBorderType: NSNoBorder];
borderSize = [cellClass sizeForBorderType: NSNoBorder];
// Get Content Size
switch (cell_type)
@ -220,11 +220,11 @@ static Class cellClass;
// Get border size
if (cell_bordered)
borderSize = [callClass sizeForBorderType: NSLineBorder];
borderSize = [cellClass sizeForBorderType: NSLineBorder];
else if (cell_bezeled)
borderSize = [callClass sizeForBorderType: NSBezelBorder];
borderSize = [cellClass sizeForBorderType: NSBezelBorder];
else
borderSize = [callClass sizeForBorderType: NSNoBorder];
borderSize = [cellClass sizeForBorderType: NSNoBorder];
return NSInsetRect (theRect, borderSize.width, borderSize.height);
}