Skip to content

Commit

Permalink
Fix GH#9514: Only apply text to the first element in range selections
Browse files Browse the repository at this point in the history
Backport of musescore#9532
  • Loading branch information
martin-danhier authored and Jojo-Schmitz committed Nov 28, 2021
1 parent ea7b16c commit e384865
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mscore/palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,16 @@ bool Palette::applyPaletteElement(Element* element, Qt::KeyboardModifiers modifi
score->cmdAddSpanner(spanner, i, startSegment, endSegment);
}
}
else if (element->isTextBase()) {
Ms::Segment* firstSegment = sel.startSegment();
int firstStaffIndex = sel.staffStart();
int lastStaffIndex = sel.staffEnd();

// A text should only be added at the start of the selection
// There shouldn't be a text at each element
for (int staff = firstStaffIndex; staff < lastStaffIndex; staff++)
applyDrop(score, viewer, firstSegment->firstElement(staff), element, modifiers);
}
else {
int track1 = sel.staffStart() * VOICES;
int track2 = sel.staffEnd() * VOICES;
Expand Down

0 comments on commit e384865

Please sign in to comment.