]> git.lyx.org Git - features.git/commitdiff
Fix repaint of unselected branch
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 15 Jan 2018 16:23:48 +0000 (17:23 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 16 Jan 2018 08:37:30 +0000 (09:37 +0100)
This works around a TextMetrics issue where Row::beg/end_margin_sel
are sometimes not reset correctly when there is no selection on the
row.

In master a fix for this problem has been done at 654cded1. Here we
prefer a much simpler work around that fixes the symptom.

Fixes bug #10972.

src/RowPainter.cpp

index a5cb04b6019fc58bc82ecb2e9bb1a256a438f097..115efba6317cf33721c28def73e9a23d18023e19 100644 (file)
@@ -77,7 +77,7 @@ FontInfo RowPainter::labelFont() const
 {
        FontInfo f = text_.labelFont(par_);
        // selected text?
-       if (row_.begin_margin_sel || pi_.selected)
+       if ((row_.selection() && row_.begin_margin_sel) || pi_.selected)
                f.setPaintColor(Color_selectiontext);
        return f;
 }