diff src/xterm.c @ 4277:c3fbb9249f5b

(redraw_previous_char): New function.
author Richard M. Stallman <rms@gnu.org>
date Sun, 25 Jul 1993 21:50:16 +0000
parents bc70363458c3
children b5014da888a8
line wrap: on
line diff
--- a/src/xterm.c	Sun Jul 25 21:48:55 1993 +0000
+++ b/src/xterm.c	Sun Jul 25 21:50:16 1993 +0000
@@ -271,6 +271,7 @@
 extern FONT_TYPE *XOpenFont ();
 
 static void flashback ();
+static void redraw_previous_char ();
 
 #ifndef HAVE_X11
 static void dumpqueue ();
@@ -288,7 +289,7 @@
    of the frame being updated, so that the XT... functions do not
    need to take a frame as argument.  Most of the XT... functions
    should never be called except during an update, the only exceptions
-   being XTcursor_to, XTwrite_char and XTreassert_line_highlight.  */
+   being XTcursor_to, XTwrite_glyphs and XTreassert_line_highlight.  */
 
 extern int mouse_track_top, mouse_track_left, mouse_track_width;
 
@@ -680,7 +681,9 @@
 	      CHAR_TO_PIXEL_ROW (f, curs_y),
 	      FONT_WIDTH (f->display.x->font) * (first_unused - curs_x),
 	      FONT_HEIGHT (f->display.x->font), False);
-	      
+#if 0
+  redraw_previous_char (f, curs_x, curs_y);
+#endif
 #else /* ! defined (HAVE_X11) */
   XPixSet (FRAME_X_WINDOW (f),
 	   CHAR_TO_PIXEL_COL (f, curs_x),
@@ -693,6 +696,38 @@
   UNBLOCK_INPUT;
 }
 
+/* Erase the character (if any) at the position just before X, Y in frame F,
+   then redraw it and the character before it.
+   This is necessary when we erase starting at X,
+   in case the character after X overlaps into the one before X.  */
+
+static void
+redraw_previous_char (f, x, y)
+     FRAME_PTR f;
+     int x, y;
+{
+  /* Erase the character before the new ones, in case
+     what was here before overlaps it.
+     Reoutput that character, and the previous character
+     (in case the previous character overlaps it).  */
+  if (x > 0)
+    {
+      int start_x = x - 2;
+      if (start_x < 0)
+	start_x = 0;
+      XClearArea (x_current_display, FRAME_X_WINDOW (f),
+		  CHAR_TO_PIXEL_COL (f, x - 1),
+		  CHAR_TO_PIXEL_ROW (f, y),
+		  FONT_WIDTH (f->display.x->font),
+		  FONT_HEIGHT (f->display.x->font), False);
+
+      dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x),
+		  CHAR_TO_PIXEL_ROW (f, y),
+		  &FRAME_CURRENT_GLYPHS (f)->glyphs[y][start_x],
+		  x - start_x, highlight);
+    }
+}
+
 static
 XTclear_frame ()
 {