musescore/MuseScore — pull request #770 by MarcSabatella (2014-03-14 22:46:32+00:00)
Title: fix #3325: layout of seconds and other conflicts in chords

This is a relatively big but also quite self-contained change to chord layout. It affects calculations of which notes need to be mirrored to the "wrong" side of the stem, when and by how much to offset chords between voices, how to account for dots in these same situations, and also the placement of accidentals in all cases. There were a number of interrelated problems that made sense to tackle all together. The last couple dozen or so comments in the issue thread http://musescore.org/en/node/3325 document my process and results. Also see http://musescore.org/en/node/1464#comment-97175 for some info about the accidental stacking order. The way I have structured the code it should be easy to revisit that particular decision without affecting anything else - there are actually a large number of small improvements to accidental positioning I implemented that have nothing to do with the stacking order.

I have tested enough to be confident this code puts us in far better shape than we were before, and I have added some vtests to help us catch regressions.

There are a bunch of open issues relating to specific aspects of layout that I'll close when this is merged.

At some point we should consider modifying the score reading code to strip off user mirroring and manual offsets applied to notes & chords (including dots, and accidentals), since these will now be applied to different defaults and hence will appear wrong. I am betting that in the majority of cases, such manual overrides were being performed to overcome deficiencies in the original layout. With the improvements here, hopefully the default results will be good enough no one will notice or complain.