diff --git a/Source/UIImage+ASConvenience.mm b/Source/UIImage+ASConvenience.mm index cc5896b4f..524ab5d17 100644 --- a/Source/UIImage+ASConvenience.mm +++ b/Source/UIImage+ASConvenience.mm @@ -214,6 +214,15 @@ + (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius BOOL canUseCopy = (CGColorGetAlpha(borderColor.CGColor) == 1); [strokePath strokeWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1]; } + // Refill the center area with fillColor since it may be contaminated by the sub pixel + // rendering. + if (borderWidth > 0) { + CGRect rect = CGRectMake(capInset, capInset, 1, 1); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextClearRect(context, rect); + CGContextSetFillColorWithColor(context, [fillColor CGColor]); + CGContextFillRect(context, rect); + } }); UIEdgeInsets capInsets = UIEdgeInsetsMake(cornerRadius, cornerRadius, cornerRadius, cornerRadius);