mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[ASTextNode] Fix text node truncation (#1863)
* Before truncate a text storage in ASTextKitContext reset the text storage to original value * Fix ASTextNode tests We should pass in the constrained size in both cases and the sizes should be the same. We adjust the calculated size in ASTextNode to be a bit narrower in the second case if we truncate again with the calculated size as constrained size it will truncate more and the resulting size will shrink.
This commit is contained in:
committed by
appleguy
parent
38fab7cd94
commit
6238e5edbd
@@ -129,8 +129,12 @@ static NSCharacterSet *_defaultAvoidTruncationCharacterSet()
|
||||
// If we're updating an existing context, make sure to use the same inset logic used during initialization.
|
||||
// This codepath allows us to reuse the
|
||||
CGSize shadowConstrainedSize = [[self shadower] insetSizeWithConstrainedSize:constrainedSize];
|
||||
if (_context) _context.constrainedSize = shadowConstrainedSize;
|
||||
if (_fontSizeAdjuster) _fontSizeAdjuster.constrainedSize = shadowConstrainedSize;
|
||||
if (_context) {
|
||||
_context.constrainedSize = shadowConstrainedSize;
|
||||
}
|
||||
if (_fontSizeAdjuster) {
|
||||
_fontSizeAdjuster.constrainedSize = shadowConstrainedSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user