Y offsets change when stave space is changed
Reported version
3.x-dev
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.5.0.12237, revision: b5add95
- In new score add a dynamic. Note the Y offset = 4.00sp
- Format>Page Settings>Stave space. Note setting = 1.764mm
- Press down spin button four times. Note setting = 0.964mm
- Press OK
- Result: Dynamic's Y offset has changed to 2.19sp - Expected result: Dynamic's Y offset remains at 4.00sp (This is the behaviour with version 3.4.2)
- Format>Page Settings>Stave space. Press up button four times. Note setting = 1.764 mm
- Press OK
- Result: Dynamic's Y offset has changed to 7.32 sp(!) - Expected result: dynamic's Y offset returns to 4.00sp or stays at 2.19sp
Similar changes in Y offset occur with stave text. I have not tested other elements.
Possible but impracticable workarounds are:
a) readjust all offsets after changing score spacing, or
b) change score spacing before entering any notation.
but so impracticable they can't really be called workarounds hence the "Critical" severity.
Fix version
3.5.0
Comments
Confirmed. Same in latest 3.x development code (there is no 3.5 yet)
In reply to (No subject) by Jojo-Schmitz
So why does 3.5 appear in the dropdown in the issue tracker? And what should I specify for a bug that shows up in 3.5 beta?
3.x-dev. Setting it to Reported version to 3.5 and then have a Fixed version 3.5 would look rather stupid, wouldn't it?
Perhaps the 3.5 option should be removed from the dropdown until launch day. Or replace it with 3.5 beta or 3.5-dev until then.
Somehow I suspect one of my changes to be the culprit here, will investigate.
I understand the cause. The problem was introduced with https://github.com/musescore/MuseScore/pull/5699, but that change was actually good - we do need to call spatiumChanged for the score. The problem is the individual element spatiumChanged functions aren't necessarily doing the right thing. Values that are stored in sp units should remain as they are. Only elements stored in absolute units should be scaled.
FWIW, there is also localSpatiumChanged, which is called if a single staff is made small. Here, we actually do want to scale the values stored sp units.
Unfortunately, there are still quite a few inconsistencies here, so plenty of things that don't scale properly when scaling the score versus scaling the staff. I made a pass through this around 3.1 but I guess I missed a bunch of cases..
You say you fixed some things around 3.1 but the problem didn't occur in 3.4.2 and we are seeing a regression in 3.5 beta. Did something come unfixed?
Well, as I said, the current problem was introduced with https://github.com/musescore/MuseScore/pull/5699, which was only merged recently. A whole lot of things were not being scale correctly, that PR fixed those. Unfortunately in so doing, it caused those some of those things that were scaling correctly - like most offsets - to now get scaled twice, in effect.
The things I fixed last year had more to do with small staves, not actual changes to the overall staff space setting. Unfortunately there is not a lot of consistency to how these things are managed. But it is looking at the causes of this current bug that got me looking again at my previous fixes and finding cases I had missed.
In reply to Well, as I said, the current… by Marc Sabatella
I just noticed something else. If you change the stave space and then undo and re-do (ctrl+z. ctrl+y), you end up with the changed stave space and the correct offset. Odder and odder!
Maybe this is a workaround then. After changing the stave space, undo and redo it.
Well, that's not much of a workaround, this is critical to fix for sure. Unfortunately things were pretty broken before the PR that broke this, just differently so.
What I think I know so far:
Some things I noticed that are not handled correctly on staff scale changes are manual adjustments to arpeggios and stem lengths. I suspect beams too.
All of this is fixable, but it requires sitting down and spending time with each of these cases to work out exactly what needs to be done. Regarding undo, there is no existing undo command to change spatium it seems, but if we use undoChangeProperty (and make sure we are within a startCmd/endCmd) for each of the scaling changes we want to make, I think we're probably OK without creating any new undo commands.
In reply to I understand the cause. The… by Marc Sabatella
Why do we want to scale the values stored in sp unit in
localSpatiumChanged()
? Is it because 1sp still means the distance between two staff lines in a normal staff, even though the element is attached to a small staff?See https://github.com/musescore/MuseScore/pull/6315.
Reverts the changes for #188061: Values in sp unit don't remain unchanged after changing spatium, but fixes that one too
Thanks, @mattmcclinch !
@Howard-C - yes, that is why the offsets need to be scaled for local spatium change. We could have made the decision to keep showing the same offset, but as I recall that would have had compatibility problems.
Fixed in branch 3.x, commit b7a547279b
_Fix #307623: Y offsets change when stave space is changed
Resolves: https://musescore.org/node/307623._
Fixed in branch 3.x, commit 1068a359b8
_Merge pull request #6315 from mattmcclinch/307623-spatiumChanged
Fix #307623: Y offsets change when stave space is changed_
Fixed in branch 3.5rc, commit 81ca0f33d2
_Merge pull request #6315 from mattmcclinch/307623-spatiumChanged
Fix #307623: Y offsets change when stave space is changed_
Automatically closed -- issue fixed for 2 weeks with no activity.