Fixed some more errors with coordinate rescaling, and now trying to always choose a sphere that contains the pointer, even if the pointer is outside the canvas.