incorrect layout with user offset applied to notes and/or chords

• May 20, 2014 - 15:46
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Windows 7, GIT commit: d26a8df

In examining #25648: Accidental does not move with manual adjustment to note/chord, I have discovered a number of other issues having to do with the application of user offset to notes and/or chords. The fixes are all interrelated, so I plan to issue a single PR that fixes all of the following:

1. Layout changes after load if accidental applied to note with user offset

If a chord contains a note with a user offset, and if that note has an accidental, then initially upon load, the accidental is placed incorrectly at first. It moves to the correct position upon the first re-layout (eg, upon Ctrl+A). This is because the layout code refers to note->x() at a point where pos, readPos, and userOff are not necessarily in sync (pos has been set, but no call to adjustReadPos yet).

2. Chord with both chord and note user offsets applied results in too much space at beginning of measure

In a multi-voice context with chords in two voices at beginning of measure, if one chord is moved right, but one note of that chord is then moved left, unwanted additional space is added at the beginning of the measure. This is because the layout code calculating the amount of space needed in front of the segment is ignoring the user offset on the chord.

There's actually more side effects of these same two basic issues, but I'll leave it at this. I plan to commit fixes soon.


Comments