Skip to content

Commit

Permalink
Fix local time signature spacing bug
Browse files Browse the repository at this point in the history
Backport of musescore#23907
  • Loading branch information
mike-spa authored and Jojo-Schmitz committed Aug 11, 2024
1 parent e2e63b4 commit fcdef11
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3622,7 +3622,12 @@ void Measure::stretchMeasure(qreal targetWidth)
if (!s2->isChordRestType() && s2->element(staffIdx * VOICES))
break;
}
qreal x1 = s1 ? s1->x() + s1->minRight() : 0;
qreal x1 = 0.0;
while (s1) {
x1 = std::max(x1, s1->x() + s1->minRight());
s1 = s1->prevActive();
}

qreal x2 = s2 ? s2->x() - s2->minLeft() : targetWidth;

if (isMMRest()) {
Expand Down Expand Up @@ -4562,18 +4567,21 @@ void Measure::computeMinWidth(Segment* s, qreal x, bool isSystemHeader)

qreal d = (ww - w) / n;
qreal xx = ps->x();
bool foundAtLeastOneCrSegment = false;
for (Segment* ss = ps; ss != s;) {
Segment* ns1 = ss->nextActive();
qreal ww1 = ss->width();
if (ss->isChordRestType()) {
foundAtLeastOneCrSegment = true;
ww1 += d;
ss->setWidth(ww1);
}
xx += ww1;
ns1->rxpos() = xx;
ss = ns1;
}
w += d;
if (s->isChordRestType() || ps == s || !foundAtLeastOneCrSegment)
w += d;
x = xx;
break;
}
Expand Down

0 comments on commit fcdef11

Please sign in to comment.