add Measure->endBarLineType() method

This commit is contained in:
ws 2016-04-18 09:46:30 +02:00
parent d68ac1e9b1
commit a97b1db29c
3 changed files with 30 additions and 0 deletions

View file

@ -3419,5 +3419,31 @@ void Measure::removeSystemTrailer()
}
}
}
//---------------------------------------------------------
// endBarLineType
// Assume all barlines have same type if there is more
// than one.
//---------------------------------------------------------
BarLineType Measure::endBarLineType() const
{
// search barline segment:
Segment* s = last();
while (s && s->segmentType() != Segment::Type::EndBarLine)
s = s->prev();
// search first element
if (s) {
for (const Element* e : s->elist()) {
if (e)
return toBarLine(e)->barLineType();
}
}
return BarLineType::NORMAL;
}
}

View file

@ -263,6 +263,8 @@ class Measure : public MeasureBase {
void removeSystemHeader();
void removeSystemTrailer();
BarLineType endBarLineType() const;
};
} // namespace Ms

View file

@ -1406,6 +1406,8 @@ qreal Segment::minHorizontalDistance(Segment* ns) const
else if (st == Segment::Type::Clef) {
if (nst == Segment::Type::KeySig)
w += score()->styleP(StyleIdx::clefKeyDistance);
else if (nst == Segment::Type::ChordRest)
w += score()->styleP(StyleIdx::keyTimesigDistance);
else if (nst == Segment::Type::TimeSig)
w += score()->styleP(StyleIdx::clefTimesigDistance);
else if (nst & (Segment::Type::EndBarLine | Segment::Type::StartRepeatBarLine))