Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion TSLabel/TSLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ - (void) layoutManager: (NSLayoutManager *) layoutManager didCompleteLayoutForTe

if ( label != nil && [label isKindOfClass: [TSLabel class]] )
{
//this happens if label clips part of the content (NSInvalidArgumentException)
if([layoutManager.textContainers indexOfObject:textContainer] == NSNotFound )
layoutManager = textContainer.layoutManager;

CGRect containerGlyphBounds = [layoutManager boundingRectForGlyphRange: [layoutManager glyphRangeForTextContainer: textContainer] inTextContainer: textContainer];

// determine the bounds of each link and record that information with the TSLabel
Expand Down Expand Up @@ -239,4 +243,4 @@ - (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event
[self setAttributedText: self.attributedText];
}

@end
@end