]> git.lyx.org Git - features.git/blobdiff - src/Painter.C
a bit nice underlines
[features.git] / src / Painter.C
index fa8db6ea0cf962268cf0215a77d9c92d27f36d14..8d44c84fb244872c03f71c0eb96e569081b6e8a3 100644 (file)
@@ -324,8 +324,12 @@ void Painter::underline(LyXFont const & f, int x, int y, int width)
        // What about underbars?
        if (f.underbar() == LyXFont::ON && f.latex() != LyXFont::ON) {
                int below = max(lyxfont::maxDescent(f) / 2, 2);
-               int height = max((lyxfont::maxDescent(f) / 4) - 1, 0);
-               fillRectangle(x, y + below, width, below + height, f.color());
+               int height = max((lyxfont::maxDescent(f) / 4) - 1, 1);
+               if (height < 2)
+                       line(x, y + below, x + width, y + below, f.color());
+               else
+                       fillRectangle(x, y + below, width, below + height,
+                                     f.color());
        }
 }