mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-03-29 08:39:00 +08:00
[ASTextNode] Fix ASTextNode shadow is not rendering (#2042)
* Passing through shadow in renderer attribute * Fix memory leak setting shadow color
This commit is contained in:
committed by
Hannah Trosi
parent
99d2a3ced0
commit
c5753c44ea
@@ -44,6 +44,7 @@ struct ASTextNodeDrawParameter {
|
||||
@implementation ASTextNode {
|
||||
CGSize _shadowOffset;
|
||||
CGColorRef _shadowColor;
|
||||
UIColor *_cachedShadowUIColor;
|
||||
CGFloat _shadowOpacity;
|
||||
CGFloat _shadowRadius;
|
||||
|
||||
@@ -244,6 +245,10 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
.pointSizeScaleFactors = self.pointSizeScaleFactors,
|
||||
.layoutManagerCreationBlock = self.layoutManagerCreationBlock,
|
||||
.textStorageCreationBlock = self.textStorageCreationBlock,
|
||||
.shadowOffset = _shadowOffset,
|
||||
.shadowColor = _cachedShadowUIColor,
|
||||
.shadowOpacity = _shadowOpacity,
|
||||
.shadowRadius = _shadowRadius
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1055,7 +1060,11 @@ static CGRect ASTextNodeAdjustRenderRectForShadowPadding(CGRect rendererRect, UI
|
||||
if (shadowColor != NULL) {
|
||||
CGColorRetain(shadowColor);
|
||||
}
|
||||
if (_shadowColor != NULL) {
|
||||
CGColorRelease(_shadowColor);
|
||||
}
|
||||
_shadowColor = shadowColor;
|
||||
_cachedShadowUIColor = [UIColor colorWithCGColor:shadowColor];
|
||||
[self _invalidateRenderer];
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user