Skip to content

Commit

Permalink
Merge pull request #2063 from MarcSabatella/64911-start-repeat-space
Browse files Browse the repository at this point in the history
fix #64911: space before start repeat
  • Loading branch information
lasconic committed Jun 12, 2015
2 parents eaf2411 + b4bdcdd commit 85b0ef0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3929,8 +3929,8 @@ qreal Score::computeMinWidth(Segment* fs, bool firstMeasureInSystem)
}
if ((segType == Segment::Type::Clef) && (pt != Segment::Type::ChordRest))
minDistance = styleP(StyleIdx::clefLeftMargin);
else if (segType == Segment::Type::StartRepeatBarLine)
minDistance = .5 * _spatium;
else if (segType == Segment::Type::StartRepeatBarLine && pSeg)
minDistance = .5 * _spatium; // TODO: make style parameter
else if (segType == Segment::Type::TimeSig && pt == Segment::Type::Clef) {
// missing key signature, but allocate default margin anyhow
minDistance = styleP(StyleIdx::keysigLeftMargin);
Expand Down Expand Up @@ -3974,12 +3974,12 @@ qreal Score::computeMinWidth(Segment* fs, bool firstMeasureInSystem)
qreal sp = 0.0;

// space chord symbols unless they miss each other vertically
if (eFound || (hFound && hBbox.top() < hLastBbox[staffIdx].bottom() && hBbox.bottom() > hLastBbox[staffIdx].top()))
if (hFound && hBbox.top() < hLastBbox[staffIdx].bottom() && hBbox.bottom() > hLastBbox[staffIdx].top())
sp = hRest[staffIdx] + minHarmonyDistance + hSpace.lw();

// barline: limit space to maxHarmonyBarDistance
if (eFound && !hFound && spaceHarmony)
sp = qMin(sp, maxHarmonyBarDistance);
else if (eFound && !hFound && spaceHarmony)
sp = qMin(hRest[staffIdx], maxHarmonyBarDistance);

hLastBbox[staffIdx] = hBbox;
hRest[staffIdx] = hSpace.rw();
Expand Down
8 changes: 4 additions & 4 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3371,7 +3371,7 @@ void Measure::layoutX(qreal stretch)
}
if ((segType == Segment::Type::Clef) && (pt != Segment::Type::ChordRest))
minDistance = score()->styleS(StyleIdx::clefLeftMargin).val() * _spatium;
else if (segType == Segment::Type::StartRepeatBarLine)
else if (segType == Segment::Type::StartRepeatBarLine && pSeg)
minDistance = .5 * _spatium;
else if (segType == Segment::Type::TimeSig && pt == Segment::Type::Clef) {
// missing key signature, but allocate default margin anyhow
Expand Down Expand Up @@ -3417,12 +3417,12 @@ void Measure::layoutX(qreal stretch)
qreal sp = 0.0;

// space chord symbols unless they miss each other vertically
if (eFound || (hFound && hBbox.top() < hLastBbox[staffIdx].bottom() && hBbox.bottom() > hLastBbox[staffIdx].top()))
if (hFound && hBbox.top() < hLastBbox[staffIdx].bottom() && hBbox.bottom() > hLastBbox[staffIdx].top())
sp = hRest[staffIdx] + minHarmonyDistance + hSpace.lw();

// barline: limit space to maxHarmonyBarDistance
if (eFound && !hFound && spaceHarmony)
sp = qMin(sp, maxHarmonyBarDistance);
else if (eFound && spaceHarmony)
sp = qMin(hRest[staffIdx], maxHarmonyBarDistance);

hLastBbox[staffIdx] = hBbox;
hRest[staffIdx] = hSpace.rw();
Expand Down

0 comments on commit 85b0ef0

Please sign in to comment.