Messed up state after finding out that the scrollbars interfere with coordinate translations. (why\!)
Finally a version where the selector follows the mouse.