To me, this would seem to suggest that the "less invasive" bugfix I
proposed (by rounding) would in fact preserve the incompleteness in
the move from int to float calculations that Han-Wen probably
introduced by accident (unless (*) is motivated in a way I do not
understand). This would seem to me to suggest that (*) should be
replaced by a straight "lastpos = p;".
Agreed.
It all comes down to the question I can't answer due to lack of
knowledge about the internal workings: What's the rationale for the
claim that dy can only be integer or .5?
I think short of rewriting everything to use integers again, removing
the int cast seems like the fix more in line with what the code is
currently written to do/be.