Skip to content

Commit

Permalink
Merge pull request #1269 from MarcSabatella/31436-segno-mmrest
Browse files Browse the repository at this point in the history
fix #31436: segno et al do not display in mmrest
  • Loading branch information
lasconic committed Sep 3, 2014
2 parents bcaf73d + 81c361c commit e89b028
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "notedot.h"
#include "element.h"
#include "tremolo.h"
#include "marker.h"

namespace Ms {

Expand Down Expand Up @@ -1658,6 +1659,30 @@ static bool breakMultiMeasureRest(Measure* m)
return true;
}

// break for marker in this measure
for (Element* e : *m->el()) {
if (e->type() == Element::Type::MARKER) {
Marker* mark = static_cast<Marker*>(e);
if (!(mark->textStyle().align() & AlignmentFlags::RIGHT))
return true;
}
}

// break for marker & jump in previous measure
Measure* pm = m->prevMeasure();
if (pm) {
for (Element* e : *pm->el()) {
if (e->type() == Element::Type::JUMP) {
return true;
}
else if (e->type() == Element::Type::MARKER) {
Marker* mark = static_cast<Marker*>(e);
if (mark->textStyle().align() & AlignmentFlags::RIGHT)
return true;
}
}
}

for (Segment* s = m->first(); s; s = s->next()) {
for (Element* e : s->annotations()) {
if (e->type() == Element::Type::REHEARSAL_MARK ||
Expand Down Expand Up @@ -1741,6 +1766,11 @@ void Score::createMMRests()
qDeleteAll(*mmr->el());
mmr->el()->clear();

for (Element* e : *m->el()) {
if (e->type() == Element::Type::MARKER)
mmr->add(e->clone());
}

for (Element* e : *lm->el())
mmr->add(e->clone());

Expand Down

0 comments on commit e89b028

Please sign in to comment.