From 2c26ee517f04bf37931718192e9a631c81a7cf8b Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sat, 16 Nov 2002 01:21:22 +0000 Subject: [PATCH] (w32_get_glyph_string_clip_rect): Clip cursor tightly. --- src/w32term.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/w32term.c b/src/w32term.c index a9ab3678b37..84c9a3c1acd 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -3133,6 +3133,18 @@ w32_get_glyph_string_clip_rect (s, r) r->top = WINDOW_TO_FRAME_PIXEL_Y (s->w, r->top); + /* If drawing the cursor, don't let glyph draw outside its + advertised boundaries. Cleartype does this under some circumstances. */ + if (s->hl == DRAW_CURSOR) + { + if (s->x > r->left) + { + r_width -= s->x - r->left; + r->left = s->x; + } + r_width = min (r_width, s->first_glyph->pixel_width); + } + r->bottom = r->top + r_height; r->right = r->left + r_width; } -- 2.39.2