musescore/MuseScore — pull request #989 by BartlomiejLewandowski (2014-06-18 17:06:27+00:00)
Title: Made extendSelection aware of activeSegment.

This PR fixes the selection extend method.

It partly introduces the old behavior where a selection extended on the opposite of active element (usually left) changed to span from the new element to the start selection segment.

There was one problem with the previous code, when we created a selection of 2 elements from right to left. Only the first element was in the selection, when extending, the new end segment was the previous start segment.
Since the end segment should be a segment right after the last segment in the selection, the note was not selected.

The code below fixes this by ensuring that the swap is done correctly.