Fix Issue with Shift Selecting Across Staffs

Assert enforces ending staffidx to be higher than starting staffidx. This code reverses the two indexes if they don't satisfy idx2 >= idx1.
This commit is contained in:
apricot2012 2021-03-25 02:29:25 -07:00 committed by pereverzev+v
parent 7b96c73531
commit a7e415974a

View file

@ -3407,6 +3407,12 @@ void Score::selectRange(Element* e, int staffIdx)
if (selectedElement && e->type() == selectedElement->type()) {
int idx1 = selectedElement->staffIdx();
int idx2 = e->staffIdx();
if (idx2 < idx1) {
int temp = idx1;
idx1 = idx2;
idx2 = temp;
}
if (idx1 >= 0 && idx2 >= 0) {
Fraction t1 = selectedElement->tick();
Fraction t2 = e->tick();