Skip to content

Commit

Permalink
fix #74951: hairpin appears to remain selected
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella authored and lasconic committed Aug 29, 2015
1 parent b6d47ce commit 25be38d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
5 changes: 3 additions & 2 deletions libmscore/hairpin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,14 @@ void HairpinSegment::draw(QPainter* painter) const
TextLineSegment::draw(painter);
return;
}

QColor color;
if (selected() && !(score() && score()->printing()))
color = (track() > -1) ? MScore::selectColor[voice()] : MScore::selectColor[0];
else if (!visible())
else if (!hairpin()->visible()) // || !hairpin()->lineVisible()
color = Qt::gray;
else
color = hairpin()->curColor();
color = hairpin()->lineColor();
QPen pen(color, point(hairpin()->lineWidth()), hairpin()->lineStyle());
if (hairpin()->lineStyle() == Qt::CustomDashLine) {
QVector<qreal> pattern;
Expand Down
17 changes: 7 additions & 10 deletions libmscore/textline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TextLineSegment::~TextLineSegment()

void TextLineSegment::setSelected(bool f)
{
Element::setSelected(f);
SpannerSegment::setSelected(f);
if (_text) {
if (spannerSegmentType() == SpannerSegmentType::SINGLE || spannerSegmentType() == SpannerSegmentType::BEGIN) {
if (textLine()->_beginText)
Expand Down Expand Up @@ -75,16 +75,15 @@ void TextLineSegment::draw(QPainter* painter) const

QPointF pp2(pos2());

// color for line (text color comes from the text properties)
QColor color;
bool normalColor = false;
if (selected() && !(score() && score()->printing()))
color = (track() > -1) ? MScore::selectColor[voice()] : MScore::selectColor[0];
else if (!tl->visible())
else if (!tl->visible() || !tl->lineVisible())
color = Qt::gray;
else {
color = tl->curColor();
normalColor = true;
}
else
color = tl->lineColor();

qreal l = 0.0;
if (_text) {
SpannerSegmentType st = spannerSegmentType();
Expand All @@ -111,9 +110,7 @@ void TextLineSegment::draw(QPainter* painter) const
}

if (tl->lineVisible() || !score()->printing()) {
QPen pen(normalColor ? tl->lineColor() : color, textlineLineWidth, tl->lineStyle());
if (!tl->lineVisible())
pen.setColor(Qt::gray);
QPen pen(color, textlineLineWidth, tl->lineStyle());
if (tl->lineStyle() == Qt::CustomDashLine) {
bool palette = !(parent() && parent()->parent()); // hack for palette
QVector<qreal> pattern;
Expand Down

0 comments on commit 25be38d

Please sign in to comment.