mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-06 13:12:49 +00:00
Don't copy container during ASTextNode2 layout (#1115)
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
- Renamed `accessibleElements` to `accessibilityElements` and removed the re-definition of the property in ASDisplayView. [Jia Wern Lim](https://github.com/jiawernlim)
|
||||
- Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster. [Eric Jensen](https://github.com/ejensen)
|
||||
- Add a delegate callback for when the framework has initialized. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||
- Improve TextNode2 by skipping an unneeded copy during measurement. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||
|
||||
## 2.7
|
||||
- Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877)
|
||||
|
||||
@@ -232,19 +232,12 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
|
||||
ASLockScopeSelf();
|
||||
|
||||
ASTextContainer *container;
|
||||
if (!CGSizeEqualToSize(container.size, constrainedSize)) {
|
||||
container = [_textContainer copy];
|
||||
container.size = constrainedSize;
|
||||
[container makeImmutable];
|
||||
} else {
|
||||
container = _textContainer;
|
||||
}
|
||||
_textContainer.size = constrainedSize;
|
||||
[self _ensureTruncationText];
|
||||
|
||||
NSMutableAttributedString *mutableText = [_attributedText mutableCopy];
|
||||
[self prepareAttributedString:mutableText];
|
||||
ASTextLayout *layout = [ASTextNode2 compatibleLayoutWithContainer:container text:mutableText];
|
||||
ASTextLayout *layout = [ASTextNode2 compatibleLayoutWithContainer:_textContainer text:mutableText];
|
||||
|
||||
return layout.textBoundingSize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user