mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 12:49:02 +00:00
[UIImage+ASConvenience] as_resizableRoundedImage border doesn't respect roundedCorner argument (#2905)
* fix border path on as_resizableRoundedImageWithCornerRadius... method * add a space to force this PR to rebuild * Revert added space
This commit is contained in:
parent
6736367627
commit
d41ef55cd7
@ -76,9 +76,9 @@
|
||||
PathKey key = { roundedCorners, cornerRadius };
|
||||
NSValue *pathKeyObject = [[NSValue alloc] initWithBytes:&key objCType:@encode(PathKey)];
|
||||
|
||||
CGSize cornerRadii = CGSizeMake(cornerRadius, cornerRadius);
|
||||
UIBezierPath *path = [__pathCache objectForKey:pathKeyObject];
|
||||
if (path == nil) {
|
||||
CGSize cornerRadii = CGSizeMake(cornerRadius, cornerRadius);
|
||||
path = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:roundedCorners cornerRadii:cornerRadii];
|
||||
[__pathCache setObject:path forKey:pathKeyObject];
|
||||
}
|
||||
@ -107,7 +107,9 @@
|
||||
|
||||
// It is rarer to have a stroke path, and our cache key only handles rounded rects for the exact-stretchable
|
||||
// size calculated by cornerRadius, so we won't bother caching this path. Profiling validates this decision.
|
||||
UIBezierPath *strokePath = [UIBezierPath bezierPathWithRoundedRect:strokeRect cornerRadius:cornerRadius];
|
||||
UIBezierPath *strokePath = [UIBezierPath bezierPathWithRoundedRect:strokeRect
|
||||
byRoundingCorners:roundedCorners
|
||||
cornerRadii:cornerRadii];
|
||||
[strokePath setLineWidth:borderWidth];
|
||||
BOOL canUseCopy = (CGColorGetAlpha(borderColor.CGColor) == 1);
|
||||
[strokePath strokeWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user