]> code.delx.au - gnu-emacs/commitdiff
(w32_get_glyph_string_clip_rect): Clip cursor tightly.
authorJason Rumney <jasonr@gnu.org>
Sat, 16 Nov 2002 01:21:22 +0000 (01:21 +0000)
committerJason Rumney <jasonr@gnu.org>
Sat, 16 Nov 2002 01:21:22 +0000 (01:21 +0000)
src/w32term.c

index a9ab3678b376c9f7fb417219dd569e0fdd133789..84c9a3c1acd0774765f3a1351f58b24962e46aac 100644 (file)
@@ -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;
 }