Skip to content

Commit

Permalink
support zero-width textlines
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Oct 14, 2014
1 parent 501e9be commit 2729307
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libmscore/textline.cpp
Expand Up @@ -73,7 +73,7 @@ void TextLineSegment::draw(QPainter* painter) const
bool normalColor = false;
if (selected() && !(score() && score()->printing()))
color = MScore::selectColor[0];
else if (!tl->visible())
else if (!tl->visible() || textlineLineWidth == 0.0)
color = Qt::gray;
else {
color = tl->curColor();
Expand Down Expand Up @@ -103,6 +103,14 @@ void TextLineSegment::draw(QPainter* painter) const
painter->translate(-_endText->pos());
}
}

if (textlineLineWidth == 0.0) {
if (score() && (score()->printing() || !score()->showInvisible()))
return;
else
textlineLineWidth = 0.1 * _spatium; // Qt draws zero-width lines strangely
}

QPen pen(normalColor ? tl->lineColor() : color, textlineLineWidth, tl->lineStyle());
painter->setPen(pen);

Expand Down

0 comments on commit 2729307

Please sign in to comment.