mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:10:47 +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
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2011-05-07 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
011-05-07 Eric Wasylishen <ewasylishen@gmail.com>
|
011-05-07 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/NSView.m (-convertPoint:toView:): Correct this
|
* Source/NSView.m (-convertPoint:toView:): Correct this
|
||||||
|
|
|
@ -930,6 +930,17 @@ typedef struct _GSButtonCellFlags
|
||||||
position.y += size.height;
|
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
|
[[GSTheme theme] drawImage: imageToDisplay
|
||||||
inButtonCell: self
|
inButtonCell: self
|
||||||
withFrame: cellFrame
|
withFrame: cellFrame
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue