mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 05:32:11 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4870 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
63b1e96172
commit
c112f1be56
2 changed files with 19 additions and 7 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue