initial commit taken from v1.39

taken from http://www.scorchworks.com/Fengrave/fengrave.html
Update unit values when changing units