fix #301174: Undo selects an extra measure

Resolves: https://musescore.org/en/node/301174.

When restoring a range selection that ends on the last tick of a measure, make sure that it is not extended to the first tick of the next measure.
This commit is contained in:
Matt McClinch 2020-02-15 13:37:57 -05:00
parent b29e71f5ba
commit 40191074a3

View file

@ -507,6 +507,8 @@ void Selection::updateSelectedElements()
// the first segment for them. // the first segment for them.
return; return;
} }
if (s2 && s2 == s2->measure()->first())
s2 = s2->prev1(); // we want the last segment of the previous measure
setRange(s1, s2, staffStart, staffEnd); setRange(s1, s2, staffStart, staffEnd);
_plannedTick1 = Fraction(-1,1); _plannedTick1 = Fraction(-1,1);
_plannedTick2 = Fraction(-1,1); _plannedTick2 = Fraction(-1,1);