Merge pull request #387 from facebook/issue-89

Fix ASTextNode positioning for non-left alignment, part deux.
This commit is contained in:
Ryan Nystrom 2015-03-23 13:58:30 -07:00
commit 66624fa4e6

View File

@ -234,6 +234,18 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
}
}
- (void)setFrame:(CGRect)frame
{
[super setFrame:frame];
if (!CGSizeEqualToSize(frame.size, _constrainedSize)) {
// Our bounds have changed to a size that is not identical to our constraining size,
// so our previous layout information is invalid, and TextKit may draw at the
// incorrect origin.
_constrainedSize = CGSizeMake(-INFINITY, -INFINITY);
[self _invalidateRenderer];
}
}
- (void)setBounds:(CGRect)bounds
{
[super setBounds:bounds];