Fix ruler scale property
The ruler distance scale property was being applied cumulatively, leading to unintuitive ruler behavior, and breaking undo/redo. In addition, applied the scale factor property to change the tick spacing and distance text appropriately, and exposed the scale factor all the time, not just when ruler mode is enabled.
Fixes #16897 (closed)