Round up editable text node to the next point (#1761)

Rounding up to the next device pixel was calculating a height smaller
than  UITextView's contentSize. This was causing the baseline to move as
the user was typing.
This commit is contained in:
Vadim Spivak
2016-06-16 21:59:29 -07:00
committed by appleguy
parent aa5d730eab
commit e55037354c

View File

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