@@ -2044,6 +2044,7 @@ void Score::cmdAddTie(bool addToChord)
20442044{
20452045 const std::vector<Note*> noteList = cmdTieNoteList (selection (), noteEntryMode ());
20462046 std::vector<EngravingItem*> toSelect;
2047+
20472048 if (noteList.empty ()) {
20482049 LOGD (" no notes selected" );
20492050 return ;
@@ -2072,6 +2073,7 @@ void Score::cmdAddTie(bool addToChord)
20722073 cr = toChord (c->explicitParent ());
20732074 addToChord = true ;
20742075 } else {
2076+ m_is.setTrack (note->chord ()->track ());
20752077 m_is.setSegment (note->chord ()->segment ());
20762078 m_is.moveToNextInputPos ();
20772079 m_is.setLastSegment (m_is.segment ());
@@ -2097,6 +2099,8 @@ void Score::cmdAddTie(bool addToChord)
20972099 } else {
20982100 addFlag = true ; // re-use chord
20992101 }
2102+ } else if (!score ()->inputState ().noteEntryMode ()) {
2103+ addFlag = false ;
21002104 }
21012105
21022106 // if no note to re-use, create one
@@ -2161,13 +2165,13 @@ Tie* Score::cmdToggleTie()
21612165 }
21622166
21632167 std::vector<Note*> tieNoteList (noteList.size ());
2164- Chord* chord = noteList. front ()-> chord () ;
2168+ bool singleTick = true ;
21652169 bool someHaveExistingNextNoteToTieTo = false ;
21662170
21672171 for (size_t i = 0 ; i < noteList.size (); ++i) {
21682172 Note* n = noteList[i];
2169- if (chord && n->chord () != chord ) {
2170- chord = nullptr ;
2173+ if (n->chord ()-> tick () != noteList. front ()-> tick () ) {
2174+ singleTick = false ;
21712175 }
21722176 if (n->tieFor ()) {
21732177 tieNoteList[i] = nullptr ;
@@ -2180,9 +2184,9 @@ Tie* Score::cmdToggleTie()
21802184 }
21812185 }
21822186
2183- const bool shouldTieListSelection = noteList.size () >= 2 && !chord ;
2187+ const bool shouldTieListSelection = noteList.size () >= 2 && !singleTick ;
21842188
2185- if (chord ) { /* i.e. all notes are in the same chord */
2189+ if (singleTick ) { /* i.e. all notes are in the same tick */
21862190 cmdAddTie (true );
21872191 return nullptr ;
21882192 }
0 commit comments