Fix mouse coordinate calculation.