commit f00a3e9304d89749ddd210e24ac132a7e8525cdf
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Thu Sep 20 11:31:23 2018 +0200

    Paint underline for insets too.
    
    Fixes bug 11297.
    
    (cherry picked from commit 328ff9df3a4ac217a0424743575a0c7c293361ea)
---
 src/RowPainter.cpp |   18 +++++++++++++++++-
 src/RowPainter.h   |    1 +
 status.23x         |    2 ++
 3 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp
index 94516ba..c6578ce 100644
--- a/src/RowPainter.cpp
+++ b/src/RowPainter.cpp
@@ -239,6 +239,21 @@ void RowPainter::paintStringAndSel(Row::Element const & e) 
const
 }
 
 
+void RowPainter::paintTextDecoration(Row::Element const & e) const
+{
+       // element selected?
+       bool const sel = (e.pos >= row_.sel_beg && e.endpos <= row_.sel_end)
+               || pi_.selected;
+       FontInfo copy = e.font.fontInfo();
+       if (sel || e.change.changed()) {
+               Color const col = e.change.changed() ? e.change.color()
+                                                    : Color_selectiontext;
+               copy.setPaintColor(col);
+       }
+       pi_.pain.textDecoration(copy, int(x_), yo_, int(e.full_width()));
+}
+
+
 void RowPainter::paintChange(Row::Element const & e) const
 {
        e.change.paintCue(pi_, x_, yo_, x_ + e.full_width(), e.font.fontInfo());
@@ -570,10 +585,11 @@ void RowPainter::paintText()
 
                case Row::INSET:
                        paintInset(e);
+                       paintTextDecoration(e);
                        break;
 
                case Row::SPACE:
-                       pi_.pain.textDecoration(e.font.fontInfo(), int(x_), 
yo_, int(e.full_width()));
+                       paintTextDecoration(e);
                }
 
                // The line that indicates word in a different language
diff --git a/src/RowPainter.h b/src/RowPainter.h
index 99f0c8c..dc43eaa 100644
--- a/src/RowPainter.h
+++ b/src/RowPainter.h
@@ -59,6 +59,7 @@ public:
 private:
        void paintForeignMark(Row::Element const & e) const;
        void paintStringAndSel(Row::Element const & e) const;
+       void paintTextDecoration(Row::Element const & e) const;
        void paintMisspelledMark(Row::Element const & e) const;
        void paintChange(Row::Element const & e) const;
        void paintAppendixStart(int y) const;
diff --git a/status.23x b/status.23x
index ceab95d..7f5e56d 100644
--- a/status.23x
+++ b/status.23x
@@ -59,6 +59,8 @@ What's new
 
 - When using formal tables, draw top/bottom rules thicker when adequate.
 
+- Draw underline (and friends) over insets too (bug 11297).
+
 - Handle properly branches with a space in their name (bug 11108).
 
 

Reply via email to