The ruler is now constrained to move within the bounds of the browser window. It does not work perfectly, it mostly fixed problem where dragging the ruler too far would scroll the page.