diff --git a/AsyncDisplayKit/ASTextNode.mm b/AsyncDisplayKit/ASTextNode.mm index 6695f328c4..8004ef6b91 100644 --- a/AsyncDisplayKit/ASTextNode.mm +++ b/AsyncDisplayKit/ASTextNode.mm @@ -234,6 +234,18 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f) } } +- (void)setBounds:(CGRect)bounds +{ + [super setBounds:bounds]; + if (!CGSizeEqualToSize(bounds.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]; + } +} + #pragma mark - Renderer Management - (ASTextNodeRenderer *)_renderer