Fix painting of selection with change tracking

When partially selecting an element, the selected text color was not
the same as when selecting it completely.

Fixes bug #9809.
This commit is contained in:
Jean-Marc Lasgouttes 2015-10-28 10:29:48 +01:00
parent c061e339f9
commit febbcf7f6c

View File

@ -243,13 +243,11 @@ void RowPainter::paintStringAndSel(Row::Element const & e)
bool const all_sel = (e.pos >= row_.sel_beg && e.endpos < row_.sel_end) bool const all_sel = (e.pos >= row_.sel_beg && e.endpos < row_.sel_end)
|| pi_.selected; || pi_.selected;
if (all_sel) { if (all_sel || e.change.changed()) {
Font copy = e.font; Font copy = e.font;
copy.fontInfo().setPaintColor(Color_selectiontext); Color const col = e.change.changed() ? e.change.color()
pi_.pain.text(int(x_), yo_, e.str, copy, e.extra); : Color_selectiontext;
} else if (e.change.changed()) { copy.fontInfo().setPaintColor(col);
Font copy = e.font;
copy.fontInfo().setPaintColor(e.change.color());
pi_.pain.text(int(x_), yo_, e.str, copy, e.extra); pi_.pain.text(int(x_), yo_, e.str, copy, e.extra);
} else if (!some_sel) { } else if (!some_sel) {
pi_.pain.text(int(x_), yo_, e.str, e.font, e.extra); pi_.pain.text(int(x_), yo_, e.str, e.font, e.extra);