Fix coordinate transformation for mouse input.