Skip to content

Commit

Permalink
fix #290061: no space betwene header and clef change
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Jun 1, 2019
1 parent 5c882aa commit feffd0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4106,7 +4106,8 @@ void Measure::computeMinWidth(Segment* s, qreal x, bool isSystemHeader)
qreal w;

if (ns) {
if (isSystemHeader && ns->isChordRestType()) { // this is the system header gap
if (isSystemHeader && (ns->isChordRestType() || (ns->isClefType() && !ns->header()))) {
// this is the system header gap
w = s->minHorizontalDistance(ns, true);
isSystemHeader = false;
}
Expand Down
8 changes: 8 additions & 0 deletions libmscore/segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2079,6 +2079,14 @@ qreal Segment::minHorizontalDistance(Segment* ns, bool systemHeaderGap) const
// d = qMax(d, spatium()); // minimum distance is one spatium
// w = qMax(w, minRight()) + d;
}
else if (systemHeaderGap) {
// first segment after header is *not* a chordrest
// could be a clef
if (st == SegmentType::TimeSig)
w += score()->styleP(Sid::systemHeaderTimeSigDistance);
else
w += score()->styleP(Sid::systemHeaderDistance);
}
else if (st & (SegmentType::Clef | SegmentType::HeaderClef)) {
if (nst == SegmentType::KeySig || nst == SegmentType::KeySigAnnounce)
w += score()->styleP(Sid::clefKeyDistance);
Expand Down

0 comments on commit feffd0f

Please sign in to comment.