changeset 7648:2e85e48d42da

(change_frame_size): Keep cursor coords in range.
author Richard M. Stallman <rms@gnu.org>
date Mon, 23 May 1994 05:53:55 +0000
parents d93dff6fbc73
children eeefa4ac7978
files src/dispnew.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Mon May 23 05:41:58 1994 +0000
+++ b/src/dispnew.c	Mon May 23 05:53:55 1994 +0000
@@ -2025,7 +2025,12 @@
 
   FRAME_HEIGHT (frame) = newheight;
   FRAME_WIDTH (frame)  = newwidth;
-	
+
+  if (FRAME_CURSOR_X (frame) >= FRAME_WIDTH (frame))
+    FRAME_CURSOR_X (frame) = FRAME_WIDTH (frame) - 1;
+  if (FRAME_CURSOR_Y (frame) >= FRAME_HEIGHT (frame))
+    FRAME_CURSOR_Y (frame) = FRAME_HEIGHT (frame) - 1;
+
   remake_frame_glyphs (frame);
   calculate_costs (frame);
 }