Measure Number Offset Value Changes Everytime Opening the File
If the measure number offset is modified by user, MuseScore automatically change the offset value each time reopening the score file.
more infos here: Measure Number Offset Value Changes Everytime Opening the File
Steps to reproduce:
- Create a new score.
- Select a measure number text and modify its offset value (either X or Y or both).
- Save the file.
- Reopen the file. Check the measure number offset value we've modified in Step 2.
Expected behavior: The offset value should be the same with the value when we save the file.
Actual behavior: The offset value changes each time we reopen the score file.
Version number: MuseScore 126.96.36.1995471459, revision: 269baf7
Operating system: Windows 10 (10.0), Arch.: x86_64
Here is a test file that I've modified both X and Y value of the measure number offset at Measure 18 to 5sp. But both value change to 2.86sp when reopening it. The values will also change again if we save the file and reopen it.
I've also checked the nightly build MuseScore version (64-bit): 188.8.131.525159827, revision: c094067, and the issue can be reproduced.
My score seems to save to left alignment for the measure numbers which makes the numbers (especially double digit ones) look too far to the right. Temporary fix is to make sure the styling is X: 0.00 and Y: 2.00 with the center text alignment option selected (not the left align that seems to be the broken default).
Fixed in branch 3.x, commit 3203f5b45b
_fix #315781: measure number offset changes on reload
Measure numbers were formerly scaled with spatium, but now they are not.
The offset should still be in sp rather than mm,
so a new fucntionoffsetIsSpatiumDependent() was introduced,
analogous to sizeIsSpatiumDependent(), to allow measure numbers
to have size not scale with spatium but keep the scaling of offset.
However, the function depended on checking the parent of the element,
on the idea that measure numebrs are attached to measures,
whereas other non-spatium-dependent elements like title text are not.
Unfortunately, during score read, parent is not set yet,
so this check was failing.
Instead, this commit checks the ON_STAFF element flag,
which really tells us the same basic thing.
So, for measure numbers, ON_STAFF is true,
so even though sizeIsSpatiumDependent is false,
offsetIsSpatiumDependent will return true.
For title text and other elements for which sizeIsSPatiumDependent,
ON_STAFF is false, so the offset will continue to not scale.
This is the correct solution going forward as well
should any other elements need to have size and offset scaling
Automatically closed -- issue fixed for 2 weeks with no activity.
In reply to Auto close by System Message
As of Oct 21 2022 the measure number offset still reverts to default when an instrument visibility is changed
OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 184.108.40.2068021803, revision: 3224f34
I don't see that?
But if so, it'd be a new issue