01-31-2014, 10:27 PM
updaaaaate
Dear past me, what made you think tx = (digit * text.length) - digit or tx = ((digit-offset) * text.length) - digit worked for finding the width of the created bitmap? On that, since when did x -= (tx / 2) + ((digit-offset) / 2) make sense for the centre offset, when the tx alone should be giving the width needed?
Except well, it didn't. tx was ballsingly wrong and that wasn't obvious to me until I wanted a specific right-align value, only to discover... it wasn't drawing to the right place. I then spent a night realigning every instance of this in my own project after fixing this.
So this got an update, I fixed the bad calculations and switched around the arguments a little so that some can be omitted in a more sensible fashion. That is to say, wanting to specify a different alignment would be more common than a different offset, if you've actually got consistent number sizes.
Dear past me, what made you think tx = (digit * text.length) - digit or tx = ((digit-offset) * text.length) - digit worked for finding the width of the created bitmap? On that, since when did x -= (tx / 2) + ((digit-offset) / 2) make sense for the centre offset, when the tx alone should be giving the width needed?
Except well, it didn't. tx was ballsingly wrong and that wasn't obvious to me until I wanted a specific right-align value, only to discover... it wasn't drawing to the right place. I then spent a night realigning every instance of this in my own project after fixing this.
So this got an update, I fixed the bad calculations and switched around the arguments a little so that some can be omitted in a more sensible fashion. That is to say, wanting to specify a different alignment would be more common than a different offset, if you've actually got consistent number sizes.