mattt/TTTAttributedLabel — pull request #85 by jasongregori (2012-04-19 21:57:27+00:00)
Title: Fix for link detection inaccuracy

Override `-textRectForBounds:limitedToNumberOfLines:`

The text rect we were getting using
`-textRectForBounds:limitedToNumberOfLines:` in `-characterIndexAtPoint:`
was incorrect because it was not taking our attributed string into
account.

We were not correctly finding links if text was smaller than bounds
because the text rect was not taking our vertical centering into
affect. In addition, links towards the end of the string could be cut
off because the text rect we were getting back was for a regular string
and not our attributed string which could be bigger (for example if it
was bold).

We already had the correct code for handling this in `-drawTextInRect:`.
I simply moved the code into `-textRectForBounds:limitedToNumberOfLines:`
which makes a lot of sense.