Skip to content

Commit

Permalink
Round up editable text node to the next point (facebookarchive#1761)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vadims authored and appleguy committed Jun 17, 2016
1 parent aa5d730 commit e550373
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions AsyncDisplayKit/ASEditableTextNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
{
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
Expand Down

0 comments on commit e550373

Please sign in to comment.