
Robert Crosbie wrote:
Similar to my last post, You will loose precision when casting from float to int or NRShort (whatever that is).
In desktop-snap.c if all the code is doing is figuring out the slope, then perhaps dx? and dy? should be floats as well. What happens if the slope is less than 0.5? Would we catch it? I don't know what dx and dy are used later for, so maybe it has to be this way.
When doing transformations you want to keep numbers as floats for as long as possible and only convert them to ints when they finally need to be plotted to the screen. Otherwise you lose precision and you may find that after a few rotate transformations, your object is not only rotated, it has also shifted position slightly.
Except that freetype uses only fixed point arithmetic.
njh