Skip to content

Commit

Permalink
fix #25941
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jul 2, 2014
1 parent 6c89edb commit 7aa55d0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 52 deletions.
44 changes: 19 additions & 25 deletions libmscore/layout.cpp
Expand Up @@ -1377,11 +1377,10 @@ void Score::doLayout()

rebuildBspTree();

int n = viewer.size();
for (int i = 0; i < n; ++i) {
viewer.at(i)->layoutChanged();
viewer.at(i)->updateLoopCursors();
}
for (MuseScoreView* v : viewer) {
v->layoutChanged();
v->updateLoopCursors();
}

_layoutAll = false;
}
Expand All @@ -1401,27 +1400,22 @@ void Score::layoutSpanner()
for (int i = 0; i < n; ++i)
segment->annotations().at(i)->layout();
}
Element* e = segment->element(track);
if (!e)
continue;
if (e->isChordRest()) {
Chord* c = static_cast<Chord*>(e);
if (c->type() == Element::Type::CHORD) {
for (Chord* cc : c->graceNotes()) {
for (Element* e : cc->el()) {
if (e->type() == Element::Type::SLUR)
e->layout();
}
}
c->layoutStem();
for (Note* n : c->notes()) {
Tie* tie = n->tieFor();
if (tie)
tie->layout();
for (Spanner* sp : n->spannerFor())
sp->layout();
Chord* c = static_cast<Chord*>(segment->element(track));
if (c && c->type() == Element::Type::CHORD) {
for (Chord* cc : c->graceNotes()) {
for (Element* e : cc->el()) {
if (e->type() == Element::Type::SLUR)
e->layout();
}
}
c->layoutStem();
for (Note* n : c->notes()) {
Tie* tie = n->tieFor();
if (tie)
tie->layout();
for (Spanner* sp : n->spannerFor())
sp->layout();
}
}
}
}
Expand Down Expand Up @@ -3243,7 +3237,7 @@ void Score::doLayoutSystems()
rebuildBspTree();
_updateAll = true;

foreach(MuseScoreView* v, viewer)
for (MuseScoreView* v : viewer)
v->layoutChanged();
}

Expand Down
31 changes: 17 additions & 14 deletions libmscore/measure.cpp
Expand Up @@ -650,22 +650,25 @@ void Measure::layout2()
track += VOICES-1;
continue;
}
Element* el = s->element(track);
if (el) {
ChordRest* cr = static_cast<ChordRest*>(el);
if (cr->type() == Element::Type::CHORD) {
Chord* c = static_cast<Chord*>(cr);
foreach(const Note* note, c->notes()) {
foreach (Spanner* sp, note->spannerFor())
sp->layout();
}
}
DurationElement* de = cr;
while (de->tuplet() && de->tuplet()->elements().front() == de) {
de->tuplet()->layout();
de = de->tuplet();
ChordRest* cr = static_cast<ChordRest*>(s->element(track));
if (!cr)
continue;

if (cr->type() == Element::Type::CHORD) {
Chord* c = static_cast<Chord*>(cr);
for (const Note* note : c->notes()) {
Tie* tie = note->tieFor();
if (tie)
tie->layout();
foreach (Spanner* sp, note->spannerFor())
sp->layout();
}
}
DurationElement* de = cr;
while (de->tuplet() && de->tuplet()->elements().front() == de) {
de->tuplet()->layout();
de = de->tuplet();
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions libmscore/slur.cpp
Expand Up @@ -689,7 +689,7 @@ void Slur::slurPosChord(SlurPos* sp)
{
Chord* stChord;
Chord* enChord ;
if(startChord()->isGraceAfter()){ // grace notes after, coming in reverse order
if (startChord()->isGraceAfter()){ // grace notes after, coming in reverse order
stChord = endChord();
enChord = startChord();
_up = false;
Expand Down Expand Up @@ -778,8 +778,8 @@ void Slur::slurPos(SlurPos* sp)
if (sp->system1 == 0 || sp->system2 == 0)
return;

sp->p1 = scr->pagePos() - sp->system1->pagePos();
sp->p2 = ecr->pagePos() - sp->system2->pagePos();
sp->p1 = scr->pagePos() - sp->system1->pagePos();
sp->p2 = ecr->pagePos() - sp->system2->pagePos();

qreal xo, yo;

Expand Down
4 changes: 0 additions & 4 deletions libmscore/tie.cpp
Expand Up @@ -361,10 +361,6 @@ void Tie::layout()
QPointF off1(xo1, yo);
QPointF off2(0.0, yo);

#if 0 // yet(?) unused
QPointF ppos(pagePos());
#endif

// TODO: cleanup

SlurPos sPos;
Expand Down
9 changes: 3 additions & 6 deletions libmscore/undo.cpp
Expand Up @@ -2441,12 +2441,9 @@ void ChangePart::flip()
score->setInstrumentsChanged(true);
score->setPlaylistDirty(true);

Interval oint = oi.transpose();
Interval nint = part->instr()->transpose();
if (oint != nint) {
printf("ChangePart transpose %d %d %d %d\n", oint.diatonic, oint.chromatic,
nint.diatonic, nint.chromatic);
}
// Interval oint = oi.transpose();
// Interval nint = part->instr()->transpose();

// check if notes need to be updated
// true if changing into or away from TAB or from one TAB type to another

Expand Down

0 comments on commit 7aa55d0

Please sign in to comment.