Chord Symbols > Maximum Shift Above is weird if measure has rhythm slashes and rests

• Jul 17, 2020 - 05:39
Reported version
P1 - High
S3 - Major

Open attached MSCZ with MuseScore 3.5 RC.

MSCZ is a default template with Style > Chord Symbols > Maximum Shift Above set to 7.

Click on the last measure of the first system

Observe weirdness.


Attachment Size
Quirky Chord Alignment Behavior.mscz 6.74 KB


Playing around with this a little, I am inclined to think the issue isn't so much with the alignment code per see as it is with the click-a-rest code - not correctly triggering the necessary layout or something like that. I remember other issues we had earlier with this. I am investigating. I don't really know the alignment code but can't really see how this particular issue could be caused by anything going wrong there specifically.

Title Chord Symbols > Maximum Shift Above is weird if measure has rhythm slashes and rests Chord symbol alignment fails when selecting a rest with chord symbol

Indeed, it seems the alignment code itself is fine, it just isn't being called when we perform a selection, and if there is a chord symbol attached to a rest, it will get laid out without consideration to the alignment facility at all and thus will fall to its default position.

So, simple test case:

1) chord symbol above an empty measure
2) chord symbol above a measure containing a note high above the staff
3) set the maximum shift above to make sure the first chord is moved up
4) click the rest in the empty measure

Same thing will happen.

We know the cause; fix is under investigation.

It's actually not even necessary to use chord alignment at all to see the effect of this. Just have a note in voice 1 way above the staff, a rest in voice 2 on that same beat. Attach a chord symbol to the note - autoplace will automatically move it up to avoid the collision (make sure the note is high enough for this to be necessary). Now, click the rest, and the chord jumps down and collides with the note.

Status PR created fixed

Fixed in branch 3.x, commit 084770c4cd

_Fix #307946 Fix #307945 - Strange behavior with chord alignment.

Harmony::calculateBoundingRect() no longer sets the new position of the Harmony but returns it.
Harmony::layout1() ignores the the position while Harmony::layout() will use to set the position of the

Fix version