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
5 changes: 3 additions & 2 deletions TSLabel/TSLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ - (void) layoutManager: (NSLayoutManager *) layoutManager didCompleteLayoutForTe

NSRange glyphRange = [layoutManager glyphRangeForCharacterRange: range actualCharacterRange: nil];
CGRect bounds = [layoutManager boundingRectForGlyphRange: glyphRange inTextContainer: textContainer];
link.bounds = CGRectOffset(bounds, 0, (label.bounds.size.height-containerGlyphBounds.size.height)/2);
CGRect boundsOffset = CGRectOffset(bounds, 0, (label.bounds.size.height-containerGlyphBounds.size.height)/2);
link.bounds = CGRectMake(boundsOffset.origin.x - 7.5, boundsOffset.origin.y - 7.5, boundsOffset.size.width + 15, boundsOffset.size.height + 15); // Make links more tappable by increasing the bounding box

[links addObject: link];
}
Expand Down Expand Up @@ -239,4 +240,4 @@ - (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event
[self setAttributedText: self.attributedText];
}

@end
@end