This commit is contained in:
ws 2013-07-29 18:06:11 +02:00
parent 6cbea6b518
commit 889fda3817
4 changed files with 7 additions and 4 deletions

View file

@ -663,8 +663,8 @@ void Score::doLayout()
sp->setTick2(lastMeasure()->endTick());
sp->staff()->updateOttava(static_cast<Ottava*>(sp));
}
if (sp->tick() == -1 || sp->tick2() == -1) {
printf("bad spanner id %d %s %d - %d\n", sp->id(), sp->name(), sp->tick(), sp->tick2());
if (sp->tick() == -1) {
qDebug("bad spanner id %d %s %d - %d", sp->id(), sp->name(), sp->tick(), sp->tick2());
}
else
sp->layout();

View file

@ -168,9 +168,9 @@ void Score::pasteStaff(XmlReader& e, ChordRest* dst)
|| tag == "Slur"
|| tag == "Volta") {
Spanner* sp = static_cast<Spanner*>(Element::name2Element(tag, this));
sp->setTrack(dstStaffIdx * VOICES);
sp->setAnchor(Spanner::ANCHOR_SEGMENT);
sp->read(e);
sp->setTrack(dstStaffIdx * VOICES);
sp->setTick(e.tick() - tickStart + dstTick);
addSpanner(sp);
}

View file

@ -1190,7 +1190,8 @@ void Score::writeSegments(Xml& xml, const Measure* m, int strack, int etrack,
if (s->track() != track || s->generated())
continue;
if (s->tick() == segment->tick() && (!clip || s->tick2() < ls->tick())) {
int endTick = ls == 0 ? lastMeasure()->endTick() : ls->tick();
if (s->tick() == segment->tick() && (!clip || s->tick2() < endTick)) {
if (needTick) {
xml.tag("tick", segment->tick() - xml.tickDiff);
xml.curTick = segment->tick();

View file

@ -376,6 +376,8 @@ void Spanner::computeEndElement()
case ANCHOR_MEASURE:
_endElement = score()->tick2measure(tick2() - 1);
if (!_endElement)
_endElement = score()->lastMeasure();
break;
case ANCHOR_CHORD: