Closed rhalff closed 5 years ago
Probably, this was attempt to cast type if source was string (not int). But i don't remember why. May be, code was just copy-pasted between similar places.
You are right, it looks strange.
Thanks for the answer, at least I know why it could be there.
Hi, I'm trying to port this code to dart and I'm not sure about the usage of parseInt() in several places. e.g https://github.com/fontello/svg2ttf/blob/master/lib/sfnt.js#L89
parseInt in these places is not used to convert from a string to integer, but it does result in the float value to be floored.
Are these values meant to be floored at all? If so perhaps using Math.floor() is faster (and more clear).
https://jsperf.com/test-parseint-and-math-floor