# HG changeset patch # User Kenichi Handa # Date 1211714071 0 # Node ID 9a9e4682d009fe36cdcc5aba2b95ec53634916ed # Parent 50c2a5438c6cf11830e181505c9a5fa3e5c0a4c9 (x_draw_glyph_string): Fix calculation of underline position. diff -r 50c2a5438c6c -r 9a9e4682d009 src/xterm.c --- a/src/xterm.c Sun May 25 11:09:53 2008 +0000 +++ b/src/xterm.c Sun May 25 11:14:31 2008 +0000 @@ -2725,7 +2725,7 @@ else thickness = 1; if (x_underline_at_descent_line) - position = (s->height - thickness) - s->ybase; + position = (s->height - thickness) - (s->ybase - s->y); else { /* Get the underline position. This is the recommended @@ -2746,7 +2746,7 @@ /* 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; + position = (s->height - 1) - (s->ybase - s->y); if (s->y + s->height < s->ybase + position + thickness) thickness = (s->y + s->height) - (s->ybase + position); s->underline_thickness = thickness;