-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/draw should accept FP coordinates/values #130
Comments
ES6 has Math.fround, but on every call to drawPoint rounding and conversion may get expensive. Not sure the efficiency of parseInt, or match on every call either. Oh, and I'm referring to only the drawPoint function |
Both of these are unfortunately pretty slow. I particularly care about the performance of drawPoint, so I would have that one directly use $ir_is_int32(x) before making a call. The other functions could use $rt_toInt32(x). |
Hmm..im thinking those IR functions may beat other FP to int conversion methods, like Mozillas fround..possibly |
They're more direct ways of telling Higgs what you want to do. The parseInt function is not optimized for performance, and there's some dynamic lookup overhead. |
I ran into an issue while using lib/draw, particularly the drawPoint function. I was supplying integer coordinates, but the values were internally stored as the f64 type (output of Math.floor). The calls to drawPoint simply didn't draw anything on the screen.
I remembered a previous discussion we had and use a trick to force an integer conversion. However, I think this issue needs to be fixed. Newbies will surely find it very confusing.
The text was updated successfully, but these errors were encountered: