fixed a wraparound bug for negative bitmap coordinates.