From 49ad1d991e2fe0650a0f853cb1f45409d8cc0634 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 7 Aug 2000 21:54:31 +0000 Subject: [PATCH] (x_draw_image_foreground): Avoid drawing outside of the clip area when image doesn't have a mask. --- src/ChangeLog | 15 +++++++++++++++ src/xterm.c | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d0623ccc0b7..1b1def22adb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,20 @@ 2000-08-07 Gerd Moellmann + * xdisp.c (start_display): WHen starting display on a continuation + line, clear ascent and descent members of the iterator structure; + the height of the continued line does not affect the height of the + continuation line. + (make_cursor_line_fully_visible): Do nothing if cursor is on a + line taller than the window. + (redisplay_window) : Handle case that the + middle of the window is not found in any row. + (dump_glyph_row): Show more information. + (compute_line_metrics): Use MATRIX_FIRST_TEXT_ROW to determine the + first text line in a glyph matrix. + + * xterm.c (x_draw_image_foreground): Avoid drawing outside + of the clip area when image doesn't have a mask. + * fns.c (sweep_weak_table): Fix survival conditions for key-or-value and key-and-value weakness. diff --git a/src/xterm.c b/src/xterm.c index aec7d3b7338..391fd0f8ee1 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3720,8 +3720,18 @@ x_draw_image_foreground (s) } else { - XCopyArea (s->display, s->img->pixmap, s->window, s->gc, - 0, 0, s->img->width, s->img->height, x, y); + unsigned long mask = GCClipXOrigin | GCClipYOrigin | GCFunction; + XGCValues xgcv; + XRectangle clip_rect, image_rect, r; + + x_get_glyph_string_clip_rect (s, &clip_rect); + image_rect.x = x; + image_rect.y = y; + image_rect.width = s->img->width; + image_rect.height = s->img->height; + if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) + XCopyArea (s->display, s->img->pixmap, s->window, s->gc, + r.x - x, r.y - y, r.width, r.height, r.x, r.y); /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will -- 2.39.2