Manual adjustment of tuplets above the staff lost on next layout

• Jun 28, 2019 - 22:53
Reported version
3.2
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

Reported in https://musescore.org/en/node/291435.

1) default score
2) enter a quarter note triplet on mid-staff "A"
3) adjust the tuplet bracket toward the staff, but not touching it
4) edit something else on that system

Result: the tuplet jumps up

You can see after step 3) that min distance is wrong in the Inspector, it should get smaller, not larger, as you approach the staff.

Workaround is to manually set min distance to 0 (or negative) for any above-staff tuplets you want to manually adjust.


Comments

Actually, the only problem with the code here is that rebaseMinDistance() looks at placeAbove() to decide which direction is closer to the staff, and placeAbove() is returning false even though the tuplet is above the staff, because tuplets apparently don't use the placement flag.

We already have the "above" parameter at the point we call rebaseMinDistance, I suppose we could just pass that in rather than have rebaseMinDistance() call placeAbove(). Or rebaseMinDistance could special-case tuplets and check isUp() instead. Or we could override Tuplet::placement() to return _isUp.

Fix version
3.2.3