diff --git a/ChangeLog b/ChangeLog index 2a268ec69..176e5307c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-05-07 Eric Wasylishen + + * 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 * Source/NSView.m (-convertPoint:toView:): Correct this diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index f9bafdac0..a759cd7c3 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -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