Added rounding to avoid half pixel positions.