mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 21:00:10 +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 };
|
PathKey key = { roundedCorners, cornerRadius };
|
||||||
NSValue *pathKeyObject = [[NSValue alloc] initWithBytes:&key objCType:@encode(PathKey)];
|
NSValue *pathKeyObject = [[NSValue alloc] initWithBytes:&key objCType:@encode(PathKey)];
|
||||||
|
|
||||||
|
CGSize cornerRadii = CGSizeMake(cornerRadius, cornerRadius);
|
||||||
UIBezierPath *path = [__pathCache objectForKey:pathKeyObject];
|
UIBezierPath *path = [__pathCache objectForKey:pathKeyObject];
|
||||||
if (path == nil) {
|
if (path == nil) {
|
||||||
CGSize cornerRadii = CGSizeMake(cornerRadius, cornerRadius);
|
|
||||||
path = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:roundedCorners cornerRadii:cornerRadii];
|
path = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:roundedCorners cornerRadii:cornerRadii];
|
||||||
[__pathCache setObject:path forKey:pathKeyObject];
|
[__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
|
// 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.
|
// 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];
|
[strokePath setLineWidth:borderWidth];
|
||||||
BOOL canUseCopy = (CGColorGetAlpha(borderColor.CGColor) == 1);
|
BOOL canUseCopy = (CGColorGetAlpha(borderColor.CGColor) == 1);
|
||||||
[strokePath strokeWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1];
|
[strokePath strokeWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user