musescore/MuseScore — pull request #812 by MarcSabatella (2014-03-31 06:21:53+00:00)
Title: fix #24895: ties can collide with staff lines

See issue thread: http://musescore.org/en/node/24895.

This changes makes ties (and slurs, although this will rarely be an issue) avoid collision with staff lines. If the originally-calculated SlurSegment is so close to a staff line that it is hard to see, its Y position is adjusted automatically to make it more visible Specifically, with this change, either the tip or endpoints of the curve must clear the nearest staff line by at least 0.5sp. If neither do, then the SlurSegment is pushed up or down until the tip of the curve sits 0.5sp from the line.

If a user edits the tie/slur (either its overall position or adjusting the control points), the Y offset calculated above is then "locked in" so the tie/slur does not inadvertently snap back to its originally-calculated position while editing or as a result of a subsequent layout change. But simply extending a slur by changing the anchor point won't trigger this "locking in".