Merge pull request #1768 from vadims/fix-editable-text-size-calculation

[ASEditableTextNode] should include insets when calculating size
This commit is contained in:
Michael Schneider
2016-06-21 13:03:01 -07:00
committed by GitHub

View File

@@ -192,7 +192,9 @@
{
ASTextKitComponents *displayedComponents = [self isDisplayingPlaceholder] ? _placeholderTextKitComponents : _textKitComponents;
CGSize textSize = [displayedComponents sizeForConstrainedWidth:constrainedSize.width];
return CGSizeMake(fminf(ceilf(textSize.width), constrainedSize.width), fminf(ceilf(textSize.height), constrainedSize.height));
CGFloat width = ceilf(textSize.width + _textContainerInset.left + _textContainerInset.right);
CGFloat height = ceilf(textSize.height + _textContainerInset.top + _textContainerInset.bottom);
return CGSizeMake(fminf(width, constrainedSize.width), fminf(height, constrainedSize.height));
}
- (void)layout