You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a small issue with sub-pixel gravity and Math.floor that can cause "bounciness" on a single pixel. See for an example: #538 (comment)
The fix is simple; use Math.round instead. This ticket is here to start a discussion around whether we want to start standardizing on using Math.round in places where we've used the inversion shortcut with double-tilde: ~~. I'm for using Math.round, and it's probably even easier for JIT engines to optimize than the double-inversion operations.
The text was updated successfully, but these errors were encountered:
I'm ok with it, as I was saying in the other ticket, yes the performances with ~~ is faster... but with the performance improvements brought by the quadtree, I suppose that we could lose a tiny bit of speed here in exchange for proper drawing position :)
@obiot I'll close this one, since it resolves the bug as reported. I also made an earlier change to replace Math.round with the same trick. There might be other areas in drawing where sub-pixel positions cause bounciness, but I think Entity is the biggest one.
There's a small issue with sub-pixel gravity and
Math.floor
that can cause "bounciness" on a single pixel. See for an example: #538 (comment)The fix is simple; use
Math.round
instead. This ticket is here to start a discussion around whether we want to start standardizing on usingMath.round
in places where we've used the inversion shortcut with double-tilde: ~~. I'm for usingMath.round
, and it's probably even easier for JIT engines to optimize than the double-inversion operations.The text was updated successfully, but these errors were encountered: