# HG changeset patch # User Kenichi Handa # Date 1211520788 0 # Node ID 4e2f379d6e446a35649418308a80f66c1eb6c8d9 # Parent 91375185a2f2824949024b44a76069e1b8c8810e (x_draw_glyph_string): Be sure to draw underline within the current line area. diff -r 91375185a2f2 -r 4e2f379d6e44 src/xterm.c --- a/src/xterm.c Fri May 23 04:46:47 2008 +0000 +++ b/src/xterm.c Fri May 23 05:33:08 2008 +0000 @@ -2743,6 +2743,12 @@ position = (s->font->descent + 1) / 2; } } + /* Check the sanity of thickness and position. We should + avoid drawing underline out of the current line area. */ + if (s->y + s->height <= s->ybase + position) + position = s->y + s->height - 1; + if (s->y + s->height < s->ybase + position + thickness) + thickness = (s->y + s->height) - (s->ybase + position); s->underline_thickness = thickness; s->underline_position = position; y = s->ybase + position;