Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bowragon

Pages: [1]
1
NGUI 3 Support / UILabel bug GetUrlByCharacterIndex
« on: July 25, 2014, 10:40:04 AM »
Hey,

I am not sure if this is fixed already, but I just found a bug under UILabel's GetUrlByCharacterIndex method.

It lacked another check for ending the url bbcode, the [/url] part. So if you click on any words that come after an already enclosed url, it will always return the url instead of null.

This is my solution to the problem:
int urlEnd = mText.IndexOf("[/url]", linkStart);
    if (characterIndex > linkStart &&
        characterIndex < urlEnd)

I just ran a little test and it solved pretty well, but I'm not sure if this is the best solution.

Pages: [1]