emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4df7bb9c01 2/2: Fix display of stretch glyphs when hscrolled on P


From: Po Lu
Subject: master 4df7bb9c01 2/2: Fix display of stretch glyphs when hscrolled on PGTK
Date: Thu, 3 Mar 2022 20:13:34 -0500 (EST)

branch: master
commit 4df7bb9c0112007d321815d00c9dca8b44b4c9b7
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix display of stretch glyphs when hscrolled on PGTK
    
    * pgtkterm.c (x_draw_stretch_glyph_string): Use correct box
    dimensions.
---
 src/pgtkterm.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index ce167fdac2..41e2f0ded0 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -2379,24 +2379,21 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
          header line and mode line.  */
       if (x < text_left_x && !s->row->mode_line_p)
        {
-         int left_x = WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w);
-         int right_x = text_left_x;
+         int background_width = s->background_width;
+         int x = s->x, text_left_x = window_box_left (s->w, TEXT_AREA);
 
-         if (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w))
-           left_x += WINDOW_LEFT_FRINGE_WIDTH (s->w);
-         else
-           right_x -= WINDOW_LEFT_FRINGE_WIDTH (s->w);
-
-         /* Adjust X and BACKGROUND_WIDTH to fit inside the space
-            between LEFT_X and RIGHT_X.  */
-         if (x < left_x)
+         /* Don't draw into left fringe or scrollbar area except for
+            header line and mode line.  */
+         if (s->area == TEXT_AREA
+             && x < text_left_x && !s->row->mode_line_p)
            {
-             background_width -= left_x - x;
-             x = left_x;
+             background_width -= text_left_x - x;
+             x = text_left_x;
            }
-         if (x + background_width > right_x)
-           background_width = right_x - x;
+         if (background_width > 0)
+           x_draw_glyph_string_bg_rect (s, x, s->y, background_width, 
s->height);
        }
+
       if (background_width > 0)
        x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]