Skip to content

Commit

Permalink
fix #22637: align multimeasure rest and repeat measure correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Sep 10, 2013
1 parent 0b96ea5 commit a08e3aa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
10 changes: 7 additions & 3 deletions libmscore/measure.cpp
Expand Up @@ -3254,10 +3254,14 @@ void Measure::layoutX(qreal stretch)
}
}
Segment* ns;
for (ns = s->next(); ns; ns = ns->next()) {
if (ns->element(track))
break;
if (t == REPEAT_MEASURE) {
for (ns = s->next(); ns; ns = ns->next()) {
if (ns->element(track))
break;
}
}
else
ns = s->next();
if (ns) {
if (ns->segmentType() == Segment::SegEndBarLine)
x2 = ns->x();
Expand Down
3 changes: 3 additions & 0 deletions libmscore/rest.cpp
Expand Up @@ -74,6 +74,9 @@ void Rest::draw(QPainter* painter) const
painter->setPen(curColor());

if (parent() && measure() && measure()->multiMeasure()) {
//only on voice 1
if((track() % VOICES) != 0)
return;
Measure* m = measure();
int n = m->multiMeasure();
qreal pw = _spatium * .7;
Expand Down
10 changes: 6 additions & 4 deletions mscore/scoreview.cpp
Expand Up @@ -4395,10 +4395,12 @@ void ScoreView::changeVoice(int voice)
is->setTrack(track);

if (is->noteEntryMode) {
is->setSegment(is->segment()->measure()->first(Segment::SegChordRest));
score()->setUpdateAll(true);
score()->end();
mscore->setPos(is->segment()->tick());
if (is->segment()) { // can be null for eg repeatMeasure
is->setSegment(is->segment()->measure()->first(Segment::SegChordRest));
score()->setUpdateAll(true);
score()->end();
mscore->setPos(is->segment()->tick());
}
}
else {
score()->startCmd();
Expand Down

0 comments on commit a08e3aa

Please sign in to comment.