changeset 34181:8f8830861b15

(expose_area): Pass x-coordinate relative to the exposed area to x_draw_glyphs instead of a window-relative coordinate.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 04 Dec 2000 16:19:04 +0000
parents 4cd2e11b3aca
children 3f2ee9f3d8bf
files src/xterm.c
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon Dec 04 16:17:49 2000 +0000
+++ b/src/xterm.c	Mon Dec 04 16:19:04 2000 +0000
@@ -5709,31 +5709,31 @@
      XRectangle *r;
      enum glyph_row_area area;
 {
-  int x;
   struct glyph *first = row->glyphs[area];
   struct glyph *end = row->glyphs[area] + row->used[area];
   struct glyph *last;
-  int first_x;
-
-  /* Set x to the window-relative start position for drawing glyphs of
-     AREA.  The first glyph of the text area can be partially visible.
-     The first glyphs of other areas cannot.  */
-  if (area == LEFT_MARGIN_AREA)
-    x = 0;
-  else if (area == TEXT_AREA)
-    x = row->x + window_box_width (w, LEFT_MARGIN_AREA);
-  else
-    x = (window_box_width (w, LEFT_MARGIN_AREA)
-	 + window_box_width (w, TEXT_AREA));
+  int first_x, start_x, x;
 
   if (area == TEXT_AREA && row->fill_line_p)
     /* If row extends face to end of line write the whole line.  */
-    x_draw_glyphs (w, x, row, area,
+    x_draw_glyphs (w, 0, row, area,
 		   0, row->used[area],
 		   row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT,
 		   NULL, NULL, 0);
   else
     {
+      /* Set START_X to the window-relative start position for drawing glyphs of
+	 AREA.  The first glyph of the text area can be partially visible.
+	 The first glyphs of other areas cannot.  */
+      if (area == LEFT_MARGIN_AREA)
+	start_x = 0;
+      else if (area == TEXT_AREA)
+	start_x = row->x + window_box_width (w, LEFT_MARGIN_AREA);
+      else
+	start_x = (window_box_width (w, LEFT_MARGIN_AREA)
+		   + window_box_width (w, TEXT_AREA));
+      x = start_x;
+
       /* Find the first glyph that must be redrawn.  */
       while (first < end
 	     && x + first->pixel_width < r->x)
@@ -5754,7 +5754,7 @@
       
       /* Repaint.  */
       if (last > first)
-	x_draw_glyphs (w, first_x, row, area,
+	x_draw_glyphs (w, first_x - start_x, row, area,
 		       first - row->glyphs[area],
 		       last - row->glyphs[area],
 		       row->inverse_p ? DRAW_INVERSE_VIDEO : DRAW_NORMAL_TEXT,