Fix float-to-int conversion problem in WriteToImage.

This bug would cause an overflow in the case of exactly 1/2 coverage,
resulting in black outlines.