@@ -101,16 +101,19 @@ - (UIImage *)drawIconWithSelection:(BOOL)selected {
101
101
102
102
// draw indicator
103
103
if (selected) {
104
- UIBezierPath* indicatorPath;
105
- CGRect indicatorRect = CGRectMake ((iconSize - indicatorSize) / 2 , (iconSize - indicatorSize) / 2 , indicatorSize, indicatorSize);
106
- if (self.isIconSquare ) {
107
- indicatorPath = [UIBezierPath bezierPathWithRect: indicatorRect];
108
- } else {
109
- indicatorPath = [UIBezierPath bezierPathWithOvalInRect: indicatorRect];
110
- }
111
- [indicatorColor setFill ];
112
- [indicatorPath fill ];
113
- CGContextAddPath (context, indicatorPath.CGPath );
104
+ // This part is edited by wongherlung so that the indicator looks like a tick.
105
+ CGRect group = CGRectMake (CGRectGetMinX (rect) + 3 , CGRectGetMinY (rect) + 3 , CGRectGetWidth (rect) - 6 , CGRectGetHeight (rect) - 6 );
106
+ UIBezierPath* bezierPath = [UIBezierPath bezierPath ];
107
+ [bezierPath moveToPoint: CGPointMake (CGRectGetMinX (group) + 0.27083 * CGRectGetWidth (group), CGRectGetMinY (group) + 0.54167 * CGRectGetHeight (group))];
108
+ [bezierPath addLineToPoint: CGPointMake (CGRectGetMinX (group) + 0.41667 * CGRectGetWidth (group), CGRectGetMinY (group) + 0.68750 * CGRectGetHeight (group))];
109
+ [bezierPath addLineToPoint: CGPointMake (CGRectGetMinX (group) + 0.75000 * CGRectGetWidth (group), CGRectGetMinY (group) + 0.35417 * CGRectGetHeight (group))];
110
+ bezierPath.lineCapStyle = kCGLineCapSquare ;
111
+
112
+ [indicatorColor setStroke ];
113
+ bezierPath.lineWidth = 1.3 ;
114
+ [bezierPath stroke ];
115
+
116
+ CGContextAddPath (context, bezierPath.CGPath );
114
117
}
115
118
116
119
UIImage *image = UIGraphicsGetImageFromCurrentImageContext ();
0 commit comments