This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,9 +76,9 @@ + (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius
7676 PathKey key = { roundedCorners, cornerRadius };
7777 NSValue *pathKeyObject = [[NSValue alloc ] initWithBytes: &key objCType: @encode (PathKey)];
7878
79+ CGSize cornerRadii = CGSizeMake (cornerRadius, cornerRadius);
7980 UIBezierPath *path = [__pathCache objectForKey: pathKeyObject];
8081 if (path == nil ) {
81- CGSize cornerRadii = CGSizeMake (cornerRadius, cornerRadius);
8282 path = [UIBezierPath bezierPathWithRoundedRect: bounds byRoundingCorners: roundedCorners cornerRadii: cornerRadii];
8383 [__pathCache setObject: path forKey: pathKeyObject];
8484 }
@@ -107,7 +107,9 @@ + (UIImage *)as_resizableRoundedImageWithCornerRadius:(CGFloat)cornerRadius
107107
108108 // It is rarer to have a stroke path, and our cache key only handles rounded rects for the exact-stretchable
109109 // size calculated by cornerRadius, so we won't bother caching this path. Profiling validates this decision.
110- UIBezierPath *strokePath = [UIBezierPath bezierPathWithRoundedRect: strokeRect cornerRadius: cornerRadius];
110+ UIBezierPath *strokePath = [UIBezierPath bezierPathWithRoundedRect: strokeRect
111+ byRoundingCorners: roundedCorners
112+ cornerRadii: cornerRadii];
111113 [strokePath setLineWidth: borderWidth];
112114 BOOL canUseCopy = (CGColorGetAlpha (borderColor.CGColor ) == 1 );
113115 [strokePath strokeWithBlendMode: (canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal ) alpha: 1 ];
You can’t perform that action at this time.
0 commit comments