mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[ASDisplayNode] Always return the thread-safe cornerRadius property, even in slow CALayer rounding mode (#749)
- Failing to do so will introduce race conditions in which the property was updated on a background thread but main thread has not executed the block that updates the property of the node's layer. During that window, the layer's property is out-of-date and can't be used. - After this change, ASDisplayNode's cornerRadius is the only source of truth and users must always use it instead of CALayer's.
This commit is contained in:
@@ -659,6 +659,12 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* @default ASCornerRoundingTypeDefaultSlowCALayer
|
||||
*/
|
||||
@property (nonatomic, assign) ASCornerRoundingType cornerRoundingType; // default=Slow CALayer .cornerRadius (offscreen rendering)
|
||||
|
||||
/** @abstract The radius to use when rounding corners of the ASDisplayNode.
|
||||
*
|
||||
* @discussion This property is thread-safe and should always be preferred over CALayer's cornerRadius property,
|
||||
* even if corner rounding type is ASCornerRoundingTypeDefaultSlowCALayer.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat cornerRadius; // default=0.0
|
||||
|
||||
@property (nonatomic, assign) BOOL clipsToBounds; // default==NO
|
||||
|
||||
Reference in New Issue
Block a user