[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] BUG: Detecting rotation at multiples of 90



transform.c, 574..586
    if (!(((int) angle) % 90))
    {
        #  (snip) Exact rotation for angles that are multiples of 90.
    }

There's a subtle bug here, in that casting to int will eliminate the
full-precision rotation on every range (90*x, 90*x + 1).  My C-fu is a
bit weak, but I think that can be fixed by changing the if statement
to:
    if ( !( angle % 90.0f ) )

-FunnyMan3595 (Charlie Nolan)