# HG changeset patch # User Kenichi Handa # Date 1211714227 0 # Node ID e76b055e122c68b9e873a6be8f30efa4d33f313f # Parent 9a9e4682d009fe36cdcc5aba2b95ec53634916ed (x_draw_glyph_string): Fix calculation of underline position. diff -r 9a9e4682d009 -r e76b055e122c src/w32term.c --- a/src/w32term.c Sun May 25 11:14:31 2008 +0000 +++ b/src/w32term.c Sun May 25 11:17:07 2008 +0000 @@ -2891,7 +2891,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 @@ -2912,7 +2912,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;