[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:
Huy Nguyen
2018-02-08 17:08:04 +00:00
committed by GitHub
parent 3ee52e5f3b
commit b4a269aabf
3 changed files with 10 additions and 9 deletions

View File

@@ -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