Improve snap-to-cursor on middle mouse button

Now a single click of the middle mouse button will snap the cursor to
the closest point under the mouse.  This makes it much easier to move to
a desired location under the mouse.