]> git.lyx.org Git - lyx.git/commitdiff
Paint underline for insets too.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 20 Sep 2018 09:31:23 +0000 (11:31 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 20 Sep 2018 15:07:10 +0000 (17:07 +0200)
Fixes bug 11297.

(cherry picked from commit 328ff9df3a4ac217a0424743575a0c7c293361ea)

src/RowPainter.cpp
src/RowPainter.h
status.23x

index 94516ba109fe5b41d5599fd1ba699a9f739149b9..c6578cee2bb31ccba2085a4a0b298571deac4cc5 100644 (file)
@@ -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
index 99f0c8c515be5463dd95e9c4a30a23400ede876d..dc43eaa4ad7e8f185c2128934ba8b2118142e106 100644 (file)
@@ -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;
index ceab95d4e64a48f3d3964e2209b20e96f81b1507..7f5e56d8139454792d87c0cd565de06c696693a6 100644 (file)
@@ -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).