From caba19badb9b85ccfc42e573281b179cac84cd3c Mon Sep 17 00:00:00 2001 From: Brandon Evans Date: Wed, 12 Dec 2012 09:53:20 -0700 Subject: [PATCH 1/2] Draw source info button on whole pixel for sharpness --- PBSourceViewCell.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBSourceViewCell.m b/PBSourceViewCell.m index 86c8ad9ac..e5ad01be6 100644 --- a/PBSourceViewCell.m +++ b/PBSourceViewCell.m @@ -70,7 +70,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)outlineView - (NSRect)infoButtonRectForBounds:(NSRect)bounds { CGFloat infoButtonWidth = 17.0f; CGFloat infoButtonHeight = 11.0f; - return NSMakeRect(NSMaxX(bounds) - infoButtonWidth, NSMinY(bounds) + (NSHeight(bounds) - infoButtonHeight)/2.0f, infoButtonWidth, infoButtonHeight); + return NSMakeRect(NSMaxX(bounds) - infoButtonWidth, ceil(NSMinY(bounds) + (NSHeight(bounds) - infoButtonHeight)/2.0f), infoButtonWidth, infoButtonHeight); } - (NSImage *)infoButtonImage { From 159f58e04f8b5c094171df9e61c0dd730b9ee0e4 Mon Sep 17 00:00:00 2001 From: Brandon Evans Date: Fri, 1 Mar 2013 14:39:08 -0700 Subject: [PATCH 2/2] Use NSIntegralRectWithOptions instead of ceil to frame the info button --- PBSourceViewCell.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PBSourceViewCell.m b/PBSourceViewCell.m index e5ad01be6..e905814ab 100644 --- a/PBSourceViewCell.m +++ b/PBSourceViewCell.m @@ -70,7 +70,8 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)outlineView - (NSRect)infoButtonRectForBounds:(NSRect)bounds { CGFloat infoButtonWidth = 17.0f; CGFloat infoButtonHeight = 11.0f; - return NSMakeRect(NSMaxX(bounds) - infoButtonWidth, ceil(NSMinY(bounds) + (NSHeight(bounds) - infoButtonHeight)/2.0f), infoButtonWidth, infoButtonHeight); + return NSIntegralRectWithOptions(NSMakeRect(NSMaxX(bounds) - infoButtonWidth, NSMinY(bounds) + (NSHeight(bounds) - infoButtonHeight)/2.0f, infoButtonWidth, infoButtonHeight), + NSAlignMinYNearest | NSAlignHeightNearest | NSAlignMinXNearest | NSAlignWidthNearest); } - (NSImage *)infoButtonImage {