If trailing rect was set early return

This commit is contained in:
Michael Schneider 2016-04-13 16:55:55 -07:00
parent 91b6995987
commit a9d0542d8f

View File

@ -345,6 +345,11 @@ static const CGFloat ASTextKitRendererTextCapHeightPadding = 1.3;
textRange = NSMakeRange([textStorage length] - 1, 1);
}];
// If trailing rect was set early return here
if (!CGRectEqualToRect(trailingRect, CGRectNull)) {
return trailingRect;
}
// Take everything after our final character as trailing space.
NSArray *finalRects = [self rectsForTextRange:textRange measureOption:ASTextKitRendererMeasureOptionLineHeight];