Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
[ASTextNode] Fix ASTextNode shadow is not rendering (#2042)
Browse files Browse the repository at this point in the history
* Passing through shadow in renderer attribute

* Fix memory leak setting shadow color
  • Loading branch information
maicki authored and garrettmoon committed Aug 15, 2016
1 parent 0e32802 commit 3e89cf0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions AsyncDisplayKit/ASTextNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ @interface ASTextNode () <UIGestureRecognizerDelegate, NSLayoutManagerDelegate>
@implementation ASTextNode {
CGSize _shadowOffset;
CGColorRef _shadowColor;
UIColor *_cachedShadowUIColor;
CGFloat _shadowOpacity;
CGFloat _shadowRadius;

Expand Down Expand Up @@ -244,6 +245,10 @@ - (ASTextKitAttributes)_rendererAttributes
.pointSizeScaleFactors = self.pointSizeScaleFactors,
.layoutManagerCreationBlock = self.layoutManagerCreationBlock,
.textStorageCreationBlock = self.textStorageCreationBlock,
.shadowOffset = _shadowOffset,
.shadowColor = _cachedShadowUIColor,
.shadowOpacity = _shadowOpacity,
.shadowRadius = _shadowRadius
};
}

Expand Down Expand Up @@ -1055,7 +1060,11 @@ - (void)setShadowColor:(CGColorRef)shadowColor
if (shadowColor != NULL) {
CGColorRetain(shadowColor);
}
if (_shadowColor != NULL) {
CGColorRelease(_shadowColor);
}
_shadowColor = shadowColor;
_cachedShadowUIColor = [UIColor colorWithCGColor:shadowColor];
[self _invalidateRenderer];
[self setNeedsDisplay];
}
Expand Down

0 comments on commit 3e89cf0

Please sign in to comment.