changeset 48360:033719ff91f1

(w32_get_glyph_string_clip_rect): Clip cursor tightly.
author Jason Rumney <jasonr@gnu.org>
date Sat, 16 Nov 2002 01:21:22 +0000
parents 1e8497bc057d
children 2ac046f0f384
files src/w32term.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Sat Nov 16 01:18:17 2002 +0000
+++ b/src/w32term.c	Sat Nov 16 01:21:22 2002 +0000
@@ -3133,6 +3133,18 @@
 
   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;
 }