summaryrefslogtreecommitdiff
path: root/src/w32term.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2014-03-27 18:25:17 +0200
committerEli Zaretskii <eliz@gnu.org>2014-03-27 18:25:17 +0200
commit0c4e715c98919593413a76a0ab1458b0d10ea287 (patch)
tree29b05b529b53adf4b3e854d29ffc0d05e757c55e /src/w32term.c
parent8de64bb862ed7221a0c558167f7b6c766603d377 (diff)
downloademacs-0c4e715c98919593413a76a0ab1458b0d10ea287.tar.gz
Fix bug #17115 with displaying on w32 images that have 'box' face.
src/w32term.c (x_draw_image_glyph_string): Fix computation of height and width of image background when it is displayed with a 'box' face.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 4c426aca921..2fe73a3eb48 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -2085,10 +2085,14 @@ x_draw_image_glyph_string (struct glyph_string *s)
int x, y;
int box_line_hwidth = eabs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
- int height;
+ int height, width;
HBITMAP pixmap = 0;
- height = s->height - 2 * box_line_vwidth;
+ height = s->height;
+ if (s->slice.y == 0)
+ height -= box_line_vwidth;
+ if (s->slice.y + s->slice.height >= s->img->height)
+ height -= box_line_vwidth;
/* Fill background with face under the image. Do it only if row is
taller than image or if image has a clip mask to reduce
@@ -2101,10 +2105,14 @@ x_draw_image_glyph_string (struct glyph_string *s)
|| s->img->pixmap == 0
|| s->width != s->background_width)
{
+ width = s->background_width;
x = s->x;
if (s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += box_line_hwidth;
+ {
+ x += box_line_hwidth;
+ width -= box_line_hwidth;
+ }
y = s->y;
if (s->slice.y == 0)
@@ -2150,7 +2158,7 @@ x_draw_image_glyph_string (struct glyph_string *s)
}
else
#endif
- x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
+ x_draw_glyph_string_bg_rect (s, x, y, width, height);
s->background_filled_p = 1;
}