Skip to content
Permalink
Browse files

Merge pull request #2418 from Jojo-Schmitz/reset-beam

fix #100481: "Reset Beam Mode" on selection only, or entire score
  • Loading branch information...
lasconic committed Mar 9, 2016
2 parents 9b460c1 + 95f7707 commit 6af7c4d6ad5eeacc5b9a018f1e7105db290800c9
Showing with 9 additions and 9 deletions.
  1. +9 −9 libmscore/cmd.cpp
@@ -1692,20 +1692,18 @@ void Score::cmdAddStretch(qreal val)

void Score::cmdResetBeamMode()
{
if (!selection().isRange()) {
bool noSelection = selection().isNone();
if (noSelection)
cmdSelectAll();
else if (!selection().isRange()) {
qDebug("no system or staff selected");
return;
}
int startTick = selection().tickStart();

int endTick = selection().tickEnd();

Segment::Type st = Segment::Type::ChordRest;
for (Segment* seg = firstMeasure()->first(st); seg; seg = seg->next1(st)) {
if (seg->tick() < startTick)
continue;
if (seg->tick() >= endTick)
break;
for (int track = 0; track < nstaves() * VOICES; ++track) {
for (Segment* seg = selection().firstChordRestSegment(); seg && seg->tick() < endTick; seg = seg->next1(Segment::Type::ChordRest)) {
for (int track = selection().staffStart() * VOICES; track < selection().staffEnd() * VOICES; ++track) {
ChordRest* cr = static_cast<ChordRest*>(seg->element(track));
if (cr == 0)
continue;
@@ -1720,6 +1718,8 @@ void Score::cmdResetBeamMode()
}
}
_layoutAll = true;
if (noSelection)
deselectAll();
}

//---------------------------------------------------------

0 comments on commit 6af7c4d

Please sign in to comment.
You can’t perform that action at this time.