Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
FIX for TextWrap font cropping glitch — Gideros Forum

FIX for TextWrap font cropping glitch

EricCarrEricCarr Member
edited September 2014 in General questions
I found when using TextWrap on centered text, the font characters seem to be cut off slightly. It seems to be a rounding issue.

I fixed it by modifying the following line to round the position:

Old code (line 98):
line:setPosition((self.width - line:getWidth())/2, height)

Fixed code:
line:setPosition(math.floor((self.width - line:getWidth())/2), height)

Maybe this will help anyone else who has come across this issue. I suppose you could technically code a round() instead of floor, but it worked well enough for me.

Eric
+1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.