From: Kenichi Handa Date: Fri, 23 May 2008 06:11:53 +0000 (+0000) Subject: (x_draw_glyph_string): Be sure to draw underline within the current X-Git-Tag: emacs-pretest-23.0.90~5338 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=efdf1b43d7bb507aca5536ee1171bd1bf6cc32d5;p=emacs.git (x_draw_glyph_string): Be sure to draw underline within the current line area. --- diff --git a/src/w32term.c b/src/w32term.c index eb45d30b54b..5f5a3f954a9 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2909,6 +2909,12 @@ x_draw_glyph_string (s) 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;