mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-06 22:33:10 +00:00
Merge pull request #697 from garrettmoon/fixCornerRadius
Corner radius and clipsToBounds should be captured outside block
This commit is contained in:
commit
6d369ff815
@ -94,6 +94,8 @@ static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync,
|
|||||||
// Capture these outside the display block so they are retained.
|
// Capture these outside the display block so they are retained.
|
||||||
UIColor *backgroundColor = self.backgroundColor;
|
UIColor *backgroundColor = self.backgroundColor;
|
||||||
CGRect bounds = self.bounds;
|
CGRect bounds = self.bounds;
|
||||||
|
CGFloat cornerRadius = self.cornerRadius;
|
||||||
|
BOOL clipsToBounds = self.clipsToBounds;
|
||||||
|
|
||||||
CGRect frame;
|
CGRect frame;
|
||||||
|
|
||||||
@ -129,7 +131,7 @@ static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync,
|
|||||||
CGContextTranslateCTM(context, frame.origin.x, frame.origin.y);
|
CGContextTranslateCTM(context, frame.origin.x, frame.origin.y);
|
||||||
|
|
||||||
//support cornerRadius
|
//support cornerRadius
|
||||||
if (rasterizingFromAscendent && self.cornerRadius && self.clipsToBounds) {
|
if (rasterizingFromAscendent && cornerRadius && clipsToBounds) {
|
||||||
[[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:self.cornerRadius] addClip];
|
[[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:self.cornerRadius] addClip];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user