Layout / undo issues with clef change after repeat barline

• Oct 22, 2013 - 07:33
S4 - Minor

Expected result:
actual result, after dragging treble clef from palette onto a note of the 1st chord in bass clef:

Seen/tested with 4c859d8

Stems from a question in the German Forum

Attachment Size
localclefchange.mscx 19.35 KB


We currently don't really support a clef change at the beginning of a bar like this. There is code to automatically convert them into clef changes at the end of the previous bar, but it doesn't always work. I have a fix for that, but even with my fix, this case still does not work correctly.

The file attached above was created with an older build and may not be valid, but here are steps to reproduce problems from scratch:

1) new score, treble clef template
2) add start repeat to bar 5 (first bar of second system)
3) add a quarter note for bar 5
4) drag bass clef to that note - this should displa a "mid-measure" clef change
5) undo
6) drag bass clef to first measure

Result: second & subsequent systems still show treble clefs. Somehow, it seems adding the bass clef to the beginning of bar five made an entry in the clef map that undo did not remove (perhaps because there is *also* a generated treble clef there).

To see the layout issue, follow the first 4 steps above, but don't do steps 5-6. Instead, save and reload. The clef you added after the barline as a "mid-measure" clef change now displays before it - in place of the treble clef at the start of the system, but with no courtesy clef.

I deliver what I see (for the 6 full steps)

- With this Nightly on July 25, ceb2a50
no "mid-measure" clef after step # 4
no mid-clef step 4 on ceb2a50.jpg

- With this final result:
result step 6 on ceb2a50.jpg

- With this Nighlty on July 25:f97a8b2

ok for "mid-measure" clef after step # 4
mid-clef on f97a8b2.jpg

With this final result:
result on  f97a8b2.jpg