From febbcf7f6c1f4465e1c7e730a7d6f3065e3dd807 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 28 Oct 2015 10:29:48 +0100 Subject: [PATCH] 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. --- src/RowPainter.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index 3c19fbc743..ce5780bb4c 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -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) || pi_.selected; - if (all_sel) { + if (all_sel || e.change.changed()) { Font copy = e.font; - copy.fontInfo().setPaintColor(Color_selectiontext); - pi_.pain.text(int(x_), yo_, e.str, copy, e.extra); - } else if (e.change.changed()) { - Font copy = e.font; - copy.fontInfo().setPaintColor(e.change.color()); + Color const col = e.change.changed() ? e.change.color() + : Color_selectiontext; + copy.fontInfo().setPaintColor(col); pi_.pain.text(int(x_), yo_, e.str, copy, e.extra); } else if (!some_sel) { pi_.pain.text(int(x_), yo_, e.str, e.font, e.extra); -- 2.39.2