Skip to content

Commit be62a67

Browse files
committed
allow T on list sel
1 parent 046dd7a commit be62a67

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/engraving/editing/edit.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ void Score::cmdAddTie(bool addToChord)
20622062
}
20632063
}
20642064

2065-
if (noteEntryMode()) {
2065+
if (noteEntryMode() || selection().isList()) {
20662066
ChordRest* cr = nullptr;
20672067
Chord* c = note->chord();
20682068
int staffMove = c->staffMove();
@@ -2168,7 +2168,9 @@ Tie* Score::cmdToggleTie()
21682168
bool canAddTies = false;
21692169
const size_t notes = noteList.size();
21702170
std::vector<Note*> tieNoteList(notes);
2171-
const bool shouldTieListSelection = notes >= 2;
2171+
2172+
bool sameChord = std::all_of(noteList.begin(), noteList.end(), [&](const Note* n) { return n->chord() == noteList[0]->chord(); });
2173+
const bool shouldTieListSelection = !sameChord;
21722174

21732175
for (size_t i = 0; i < notes; ++i) {
21742176
Note* n = noteList[i];
@@ -2180,6 +2182,20 @@ Tie* Score::cmdToggleTie()
21802182
if (tieNote) {
21812183
canAddTies = true;
21822184
}
2185+
if (!tieNote && selection().isList() && sameChord) {
2186+
Tie* tie = nullptr;
2187+
2188+
if (sameChord) {
2189+
cmdAddTie();
2190+
if (notes >= 2) {
2191+
Chord* c = n->chord()->next();
2192+
for (Note* cn : c->notes()) {
2193+
score()->select(cn, SelectType::ADD);
2194+
}
2195+
}
2196+
return tie;
2197+
}
2198+
}
21832199
}
21842200
}
21852201

0 commit comments

Comments
 (0)