Comment 7 for bug 672232

Revision history for this message
David Collins (davidapc) wrote :

Okay, I think I've got it.
Essentially, we are asking Cairo to draw a "between" pixels. Cairo takes the coordinates 0.5, 0.5 to be in the middle of the top left pixel, so if you give it the coordinates of 1,1, it will take that to be the bottom right corner of the top left pixel, but it can also be interpreted as the corner of three other pixels (the surrounding pixels).

From what I can guess, if a coordinate is given that could easily belong to more than one pixel, Cairo selects the Pixel to choose differently depending on what platform it's on (Windows, Ubuntu etc.), hence this bug.

To fix this, I've offset the values so that the pencil always draw starting in the middle of the pixel, to the middle of the other pixel (we could use the absolute values to give super accuracy, but that might be a bit much for now)

I've included a patch that should fix the Pencil, however the same fundamental problem affects a few other tools like Paintbrush and eraser (if you restrict them to 1px and zoom in).