mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Convert ASTextKitComponents to an object.
ARC doesn't play nicely with structs that contain references to Objective-C objects, which causes breakage when using AsyncDisplayKit as a dynamic framework (e.g., with CocoaPods 0.36+). Fixes #198.
This commit is contained in:
@@ -49,8 +49,8 @@
|
||||
|
||||
// TextKit.
|
||||
ASDN::RecursiveMutex _textKitLock;
|
||||
ASTextKitComponents _textKitComponents;
|
||||
ASTextKitComponents _placeholderTextKitComponents;
|
||||
ASTextKitComponents *_textKitComponents;
|
||||
ASTextKitComponents *_placeholderTextKitComponents;
|
||||
// Forwards NSLayoutManagerDelegate methods related to word kerning
|
||||
ASTextNodeWordKerner *_wordKerner;
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
|
||||
{
|
||||
ASTextKitComponents displayedComponents = [self isDisplayingPlaceholder] ? _placeholderTextKitComponents : _textKitComponents;
|
||||
ASTextKitComponents *displayedComponents = [self isDisplayingPlaceholder] ? _placeholderTextKitComponents : _textKitComponents;
|
||||
CGSize textSize = ASTextKitComponentsSizeForConstrainedWidth(displayedComponents, constrainedSize.width);
|
||||
return CGSizeMake(constrainedSize.width, fminf(textSize.height, constrainedSize.height));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user