diff src/redisplay-x.c @ 42:8b8b7f3559a2 r19-15b104

Import from CVS: tag r19-15b104
author cvs
date Mon, 13 Aug 2007 08:54:51 +0200
parents d620409f5eb8
children 131b0175ea99
line wrap: on
line diff
--- a/src/redisplay-x.c	Mon Aug 13 08:54:26 2007 +0200
+++ b/src/redisplay-x.c	Mon Aug 13 08:54:51 2007 +0200
@@ -2063,12 +2063,10 @@
     default_face_font_info (window, &defascent, 0, &defheight, 0, 0);
   }
   
-  cursor_y = dl->ypos - defascent;
-  if (cursor_y < y)
-    cursor_y = y;
-  cursor_height = defheight;
-  if (cursor_y + cursor_height > y + height)
-    cursor_height = y + height - cursor_y;
+  /* make sure the cursor is entirely contained between y and y+height */
+  cursor_height = min (defheight, height);
+  cursor_y = max (y, min (y + height - cursor_height, 
+			  dl->ypos - defascent));
   
   if (focus)
     {