# HG changeset patch # User Kenichi Handa # Date 1211523113 0 # Node ID 32b09637961aa9aa0b82575fcb504e9f4a45f20f # Parent 7e6c63f88fb35a6d1e1d30ad56499a5b7ab86824 (x_draw_glyph_string): Be sure to draw underline within the current line area. diff -r 7e6c63f88fb3 -r 32b09637961a src/w32term.c --- a/src/w32term.c Fri May 23 05:33:24 2008 +0000 +++ b/src/w32term.c Fri May 23 06:11:53 2008 +0000 @@ -2909,6 +2909,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;