fix #21221
This commit is contained in:
parent
ff9fa3b2e5
commit
699906d876
3 changed files with 17 additions and 17 deletions
|
@ -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:
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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];
|
||||
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue