]> git.eshelyaron.com Git - emacs.git/commitdiff
* xdisp.c (erase_phys_cursor): Fix confusion between window-relative
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Tue, 19 Aug 2014 00:51:33 +0000 (09:51 +0900)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Tue, 19 Aug 2014 00:51:33 +0000 (09:51 +0900)
and text area-relative x-coordinates.

src/ChangeLog
src/xdisp.c

index 3d04357af592cf4d657f7bf48b542cc8fbbd07a0..0b9729d3833a533902580f3992755d512bd33316 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * xdisp.c (erase_phys_cursor): Fix confusion between window-relative
+       and text area-relative x-coordinates.
+
 2014-08-17  Eli Zaretskii  <eliz@gnu.org>
 
        Avoid overwriting the reversed_p flags in the glyph matrices when
index e7c3e922cb9d5e2a368e61c977cc65eea6a8d937..39e707171434a992765221454c216f6ff9bbe6b4 100644 (file)
@@ -27370,7 +27370,7 @@ erase_phys_cursor (struct window *w)
   /* Maybe clear the display under the cursor.  */
   if (w->phys_cursor_type == HOLLOW_BOX_CURSOR)
     {
-      int x, y, left_x;
+      int x, y;
       int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
       int width;
 
@@ -27379,13 +27379,15 @@ erase_phys_cursor (struct window *w)
        goto mark_cursor_off;
 
       width = cursor_glyph->pixel_width;
-      left_x = window_box_left_offset (w, TEXT_AREA);
       x = w->phys_cursor.x;
-      if (x < left_x)
-       width -= left_x - x;
+      if (x < 0)
+       {
+         width += x;
+         x = 0;
+       }
       width = min (width, window_box_width (w, TEXT_AREA) - x);
       y = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, cursor_row->y));
-      x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, max (x, left_x));
+      x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, x);
 
       if (width > 0)
        FRAME_RIF (f)->clear_frame_area (f, x, y, width, cursor_row->visible_height);