]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent overlapping sections of glyphs from being misaligned
authorPo Lu <luangruo@yahoo.com>
Sun, 31 Dec 2023 03:34:28 +0000 (11:34 +0800)
committerEshel Yaron <me@eshelyaron.com>
Tue, 2 Jan 2024 07:56:35 +0000 (08:56 +0100)
* src/xdisp.c (gui_fix_overlapping_area): Offset all glyphs by
ROW->x.

(cherry picked from commit 4ffd16b8e5e4635246155fdb23967707bcb70949)

src/xdisp.c

index 2a979c5cb9e07058db435217c367570652cb9cef..7023c26c1b4c2d114d260cec08156a06840c6e63 100644 (file)
@@ -33565,13 +33565,18 @@ notice_overwritten_cursor (struct window *w, enum glyph_row_area area,
 
 void
 gui_fix_overlapping_area (struct window *w, struct glyph_row *row,
-                       enum glyph_row_area area, int overlaps)
+                         enum glyph_row_area area, int overlaps)
 {
   int i, x;
 
   block_input ();
 
-  x = 0;
+  /* row->x might be smaller than zero when produced from an iterator
+     under horizontal scrolling.  Offset all measurements by this
+     basic value, lest hscrolled text with overlaps be displayed with
+     its overlapping portions misaligned.  */
+  x = row->x;
+
   for (i = 0; i < row->used[area];)
     {
       if (row->glyphs[area][i].overlaps_vertically_p)