Return CGSizeZero if ASTextNode's text length or attributed string is nil

This commit is contained in:
Sal 2015-08-13 13:53:08 -04:00 committed by rcancro
parent f7f20ca8b7
commit df730d6771

View File

@ -173,9 +173,13 @@ static const CGFloat ASTextNodeRendererTextCapHeightPadding = 1.3;
{
ASDN::MutexLocker l(_textKitLock);
if (_attributedString.string.length == 0) {
_calculatedSize = CGSizeZero;
return;
}
[self _initializeTextKitComponentsIfNeeded];
// Force glyph generation and layout, which may not have happened yet (and
// isn't triggered by -usedRectForTextContainer:).
[_layoutManager ensureLayoutForTextContainer:_textContainer];