mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 16:10:37 +00:00
* Source/NSButtonCell.m (-drawImage:withFrame:inView:): Align
the point at which the image is drawn to the nearest pixel. r32895 which reimplemented -[NSImage composite..] methods on top of -[NSImage draw...] methods means that drawing images with -compositeToPoint: no longer pixel-aligns the image automatically. The new behaviour matches Cocoa, however. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33002 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a68c89afb8
commit
ed3f7e52cd
2 changed files with 22 additions and 0 deletions
|
@ -930,6 +930,17 @@ typedef struct _GSButtonCellFlags
|
|||
position.y += size.height;
|
||||
}
|
||||
|
||||
/* Pixel-align the drawing point */
|
||||
if (controlView)
|
||||
{
|
||||
position = [controlView convertPointToBase: position];
|
||||
}
|
||||
position = NSMakePoint(round(position.x), round(position.y));
|
||||
if (controlView)
|
||||
{
|
||||
position = [controlView convertPointFromBase: position];
|
||||
}
|
||||
|
||||
[[GSTheme theme] drawImage: imageToDisplay
|
||||
inButtonCell: self
|
||||
withFrame: cellFrame
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue