Skip to content

Commit

Permalink
fix #21221
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed May 29, 2013
1 parent ff9fa3b commit 699906d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
17 changes: 8 additions & 9 deletions libmscore/barline.cpp
Expand Up @@ -175,18 +175,14 @@ void BarLine::drawDots(QPainter* painter, qreal x) const

void BarLine::draw(QPainter* painter) const
{
/* use condition in BarLine::scanElements() instead:
// if no width (because staff is set to hide bar lines), draw nothing
if (width() == 0.0)
return;
*/
qreal lw = point(score()->styleS(ST_barWidth));
qreal _spatium = score()->spatium();

qreal lw = score()->styleS(ST_barWidth).val() * _spatium;
qreal y1, y2;
getY(&y1, &y2);

QPen pen(curColor(), lw, Qt::SolidLine, Qt::FlatCap);
painter->setPen(pen);
qreal mags = magS();

switch(barLineType()) {
case BROKEN_BAR:
Expand All @@ -205,8 +201,8 @@ void BarLine::draw(QPainter* painter) const

case END_BAR:
{
qreal lw2 = point(score()->styleS(ST_endBarWidth));
qreal d = point(score()->styleS(ST_endBarDistance));
qreal lw2 = score()->styleS(ST_endBarWidth).val() * _spatium;
qreal d = score()->styleS(ST_endBarDistance).val() * _spatium;

painter->drawLine(QLineF(lw * .5, y1, lw * .5, y2));
pen.setWidthF(lw2);
Expand Down Expand Up @@ -248,6 +244,7 @@ void BarLine::draw(QPainter* painter) const
painter->drawLine(QLineF(x2, y1, x2, y2));

if (score()->styleB(ST_repeatBarTips)) {
qreal mags = magS();
symbols[score()->symIdx()][brackettipsRightUp].draw(painter, mags, QPointF(0.0, y1));
symbols[score()->symIdx()][brackettipsRightDown].draw(painter, mags, QPointF(0.0, y2));
}
Expand All @@ -256,6 +253,7 @@ void BarLine::draw(QPainter* painter) const

case END_REPEAT:
{
qreal mags = magS();
qreal lw2 = point(score()->styleS(ST_endBarWidth));
qreal d1 = point(score()->styleS(ST_endBarDistance));
const Sym& dotsym = symbols[score()->symIdx()][dotSym];
Expand All @@ -279,6 +277,7 @@ void BarLine::draw(QPainter* painter) const

case END_START_REPEAT:
{
qreal mags = magS();
qreal lw2 = point(score()->styleS(ST_endBarWidth));
qreal d1 = point(score()->styleS(ST_endBarDistance));
const Sym& dotsym = symbols[score()->symIdx()][dotSym];
Expand Down
11 changes: 5 additions & 6 deletions libmscore/layout.cpp
Expand Up @@ -998,10 +998,9 @@ bool Score::layoutSystem(qreal& minWidth, qreal w, bool isFirstSystem, bool long
nt = START_REPEAT;
}
if (ot != nt) {
qreal w =
BarLine::layoutWidth(this, nt, bl->magS())
- BarLine::layoutWidth(this, ot, bl->magS());
ww += w;
qreal mag = bl->magS();
ww += BarLine::layoutWidth(this, nt, mag)
- BarLine::layoutWidth(this, ot, mag);
}
}
qreal stretch = m->userStretch() * measureSpacing;
Expand Down Expand Up @@ -1514,9 +1513,9 @@ bool Score::doReLayout()
firstMeasure = false;
}
mb->setPos(pos);
Measure* m = static_cast<Measure*>(mb);
Measure* m = static_cast<Measure*>(mb);
qreal weight = m->ticks() * m->userStretch();
ww = m->layoutWidth() + rest * weight;
ww = m->layoutWidth() + rest * weight;
m->layout(ww);
}
else if (mb->type() == HBOX) {
Expand Down
6 changes: 4 additions & 2 deletions libmscore/measure.cpp
Expand Up @@ -3138,8 +3138,10 @@ void Measure::layoutX(qreal stretch)
int hLastIdx = -1;
int ntick = ticks(); // position of next measure

if (system()->firstMeasure() == this && system()->barLine())
x += BarLine::layoutWidth(score(), system()->barLine()->barLineType(), system()->barLine()->magS());
if (system()->firstMeasure() == this && system()->barLine()) {
BarLine* bl = system()->barLine();
x += BarLine::layoutWidth(score(), bl->barLineType(), bl->magS());
}

qreal minNoteDistance = score()->styleS(ST_minNoteDistance).val() * _spatium;

Expand Down

0 comments on commit 699906d

Please sign in to comment.