Skip to content

Commit

Permalink
Create tie with correct start and end note
Browse files Browse the repository at this point in the history
  • Loading branch information
miiizen committed Feb 28, 2025
1 parent 3257ba2 commit 2c0b17f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/engraving/dom/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,10 @@ Tie* Score::cmdToggleTie()
Note* note2 = tieNoteList[i];
if (note2) {
Note* note = noteList[i];
tie = createAndAddTie(note, note2);

Note* startNote = note->tick() <= note2->tick() ? note : note2;
Note* endNote = startNote == note2 ? note : note2;
tie = createAndAddTie(startNote, endNote);
}
}
} else {
Expand All @@ -2084,8 +2087,12 @@ Tie* Score::cmdToggleTie()
}

if (shouldTieListSelection) {
Note* startNote = noteList.at(0);
Note* endNote = noteList.at(1);
Note* note = noteList.at(0);
Note* note2 = noteList.at(1);

Note* startNote = note->tick() <= note2->tick() ? note : note2;
Note* endNote = startNote == note2 ? note : note2;

if (startNote->part() == endNote->part() && startNote->pitch() == endNote->pitch()
&& startNote->unisonIndex() == endNote->unisonIndex() && startNote->tick() != endNote->tick()) {
tie = createAndAddTie(startNote, endNote);
Expand Down

0 comments on commit 2c0b17f

Please sign in to comment.