Page Settings: storage units
Here is the PR with the current code: https://github.com/musescore/MuseScore/pull/4456
I have chosen Points x 10,000 as the units for storing all of the page settings' values, including page width/height, the margins, and the spatium itself. The available units are: Millimeters, Inches, Points, Picas, Didot and Cicero.
The reason for the 10,000 multiplier is so that the values can be stored as integral numbers, no floating point mess (thanks to Peter Jonas for that suggestion).
Currently the spatium is stored in Millimeters and all the other values are stored in Inches, all floating point values.
The reasons for choosing Points are:
1) The spatium and all internal units are based on Points. The default spatium value is 5pt, multiplied by a factor of 5 to achieve higher internal resolution (see the constant
DPI_F in the code). This means simpler unit conversions everywhere in the code because of the alignment around Points. Less conversion is better, IMO. It means simpler mathematical formulas, less numeric manipulation, etc.
2) Points are the most granular unit available, the most precise at whole number values. This is not really a critical reason, but it's not a bad one either. The multiplier (10,000) can be adjusted if a different unit is chosen.
I'll let others comment with their opposition or support for Points x 10,000 as the units. I understand that there are concerns about using Points, but I'll let others state them - I don't want to put words in anyone's mouth. Thanks in advance for sharing your point of view!