changeset 95296:e76b055e122c

(x_draw_glyph_string): Fix calculation of underline position.
author Kenichi Handa <handa@m17n.org>
date Sun, 25 May 2008 11:17:07 +0000
parents 9a9e4682d009
children 8f91c88eb15e
files src/w32term.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;