aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-04 09:13:08 +0800
committerPo Lu2022-03-04 09:13:08 +0800
commit4df7bb9c0112007d321815d00c9dca8b44b4c9b7 (patch)
treede373ecf1e66d445bec5e240e8be7e4774340ed0 /src
parentcba88c275bb2abbd65837fb27530655b0222b62b (diff)
downloademacs-4df7bb9c0112007d321815d00c9dca8b44b4c9b7.tar.gz
emacs-4df7bb9c0112007d321815d00c9dca8b44b4c9b7.zip
Fix display of stretch glyphs when hscrolled on PGTK
* pgtkterm.c (x_draw_stretch_glyph_string): Use correct box dimensions.
Diffstat (limited to 'src')
-rw-r--r--src/pgtkterm.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index ce167fdac2f..41e2f0ded0e 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -2379,24 +2379,21 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
2379 header line and mode line. */ 2379 header line and mode line. */
2380 if (x < text_left_x && !s->row->mode_line_p) 2380 if (x < text_left_x && !s->row->mode_line_p)
2381 { 2381 {
2382 int left_x = WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w); 2382 int background_width = s->background_width;
2383 int right_x = text_left_x; 2383 int x = s->x, text_left_x = window_box_left (s->w, TEXT_AREA);
2384 2384
2385 if (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w)) 2385 /* Don't draw into left fringe or scrollbar area except for
2386 left_x += WINDOW_LEFT_FRINGE_WIDTH (s->w); 2386 header line and mode line. */
2387 else 2387 if (s->area == TEXT_AREA
2388 right_x -= WINDOW_LEFT_FRINGE_WIDTH (s->w); 2388 && x < text_left_x && !s->row->mode_line_p)
2389
2390 /* Adjust X and BACKGROUND_WIDTH to fit inside the space
2391 between LEFT_X and RIGHT_X. */
2392 if (x < left_x)
2393 { 2389 {
2394 background_width -= left_x - x; 2390 background_width -= text_left_x - x;
2395 x = left_x; 2391 x = text_left_x;
2396 } 2392 }
2397 if (x + background_width > right_x) 2393 if (background_width > 0)
2398 background_width = right_x - x; 2394 x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
2399 } 2395 }
2396
2400 if (background_width > 0) 2397 if (background_width > 0)
2401 x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height); 2398 x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
2402 } 2399 }