aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2008-05-23 05:33:24 +0000
committerKenichi Handa <[email protected]>2008-05-23 05:33:24 +0000
commit90dc78a36ea3c20e8c87b27f7d96b86262d292bb (patch)
tree6183911fa2def6d25c209842c8ff4eae51d27109 /src/xterm.c
parent05012a713a11f0e8484d7a0b6c5a50b0d76b8cd2 (diff)
(x_draw_glyph_string): Be sure to draw underline within the current
line area.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index b4c49d4085..b2683298ca 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2743,6 +2743,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;