mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:47:39 +00:00
Different patches by Andreas Höschler <ahoesch@smartsoft.de>.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24846 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
df2318e0d9
commit
b7cb6503ee
6 changed files with 34 additions and 23 deletions
|
@ -616,22 +616,8 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
|
|||
- (void) drawImageWithFrame: (NSRect)cellFrame
|
||||
inView: (NSView *)controlView
|
||||
{
|
||||
NSSize size;
|
||||
NSPoint position;
|
||||
|
||||
cellFrame = [self imageRectForBounds: cellFrame];
|
||||
// FIXME: We could call drawImage:withFrame:inView: here, if we knew that the code there is correct.
|
||||
size = [_imageToDisplay 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 ([controlView isFlipped])
|
||||
position.y += size.height;
|
||||
|
||||
[_imageToDisplay compositeToPoint: position operation: NSCompositeSourceOver];
|
||||
[self drawImage: _imageToDisplay withFrame: cellFrame inView: controlView];
|
||||
}
|
||||
|
||||
- (void) drawKeyEquivalentWithFrame:(NSRect)cellFrame
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue