From e83ac77da50c4642d0d962bbd33573f59fc58fea Mon Sep 17 00:00:00 2001 From: Michal Frankowski Date: Tue, 27 Sep 2011 23:49:12 +0200 Subject: [PATCH] use UIGraphicsBeginImageContextWithOptions(size, NO, 0.0) to take advantage of retina display scale factor --- ToolDrawerView.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ToolDrawerView.m b/ToolDrawerView.m index e8e7e72..ad79587 100644 --- a/ToolDrawerView.m +++ b/ToolDrawerView.m @@ -133,7 +133,10 @@ - (void)createTabButton{ // Draw the cheveron button in either the filled or empty state; - (UIImage *)createTabButtonImageWithFillColor:(UIColor *)fillColor{ - UIGraphicsBeginImageContext(CGSizeMake(24.0, 24.0)); + + // Use UIGraphicsBeginImageContextWithOptions(size, NO, 0.0) to take advantage of retina display scale factor + // The 0.0 value supplied here is a “magic” number, which sets “the scale factor … to the scale factor of the device’s main screen” + UIGraphicsBeginImageContextWithOptions(CGSizeMake(24.0, 24.0), NO, 0); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetStrokeColorWithColor(ctx, [UIColor colorWithRed:0 green:0 blue:0 alpha:0.6].CGColor);