mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00: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
Adlai Holler
parent
03c74452b2
commit
d9db780b0b
@@ -44,6 +44,7 @@ struct ASTextNodeDrawParameter {
|
||||
@implementation ASTextNode {
|
||||
CGSize _shadowOffset;
|
||||
CGColorRef _shadowColor;
|
||||
UIColor *_cachedShadowUIColor;
|
||||
CGFloat _shadowOpacity;
|
||||
CGFloat _shadowRadius;
|
||||
|
||||
@@ -232,6 +233,10 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
.pointSizeScaleFactors = self.pointSizeScaleFactors,
|
||||
.layoutManagerCreationBlock = self.layoutManagerCreationBlock,
|
||||
.textStorageCreationBlock = self.textStorageCreationBlock,
|
||||
.shadowOffset = _shadowOffset,
|
||||
.shadowColor = _cachedShadowUIColor,
|
||||
.shadowOpacity = _shadowOpacity,
|
||||
.shadowRadius = _shadowRadius
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1043,7 +1048,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