a bit nice underlines

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@657 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-04-14 18:29:25 +00:00
parent 7670f99a23
commit 36e819ef14
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2000-04-14 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/Painter.C (underline): draw a slimer underline in most cases.
* src/lyx_main.C (error_handler): use extern "C"
2000-04-12 Lars Gullik Bjønnes <larsbj@lyx.org>

View 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());
}
}