aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2014-03-27 18:25:17 +0200
committerEli Zaretskii2014-03-27 18:25:17 +0200
commit0c4e715c98919593413a76a0ab1458b0d10ea287 (patch)
tree29b05b529b53adf4b3e854d29ffc0d05e757c55e /src
parent8de64bb862ed7221a0c558167f7b6c766603d377 (diff)
downloademacs-0c4e715c98919593413a76a0ab1458b0d10ea287.tar.gz
emacs-0c4e715c98919593413a76a0ab1458b0d10ea287.zip
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')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/w32term.c16
2 files changed, 18 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 025ea45b23b..0c24451c459 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12014-03-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * w32term.c (x_draw_image_glyph_string): Fix computation of height
4 and width of image background when it is displayed with a 'box'
5 face. (Bug#17115)
6
12014-03-26 Paul Eggert <eggert@penguin.cs.ucla.edu> 72014-03-26 Paul Eggert <eggert@penguin.cs.ucla.edu>
2 8
3 More backward-compatible fix to char-equal core dump (Bug#17011). 9 More backward-compatible fix to char-equal core dump (Bug#17011).
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)
2085 int x, y; 2085 int x, y;
2086 int box_line_hwidth = eabs (s->face->box_line_width); 2086 int box_line_hwidth = eabs (s->face->box_line_width);
2087 int box_line_vwidth = max (s->face->box_line_width, 0); 2087 int box_line_vwidth = max (s->face->box_line_width, 0);
2088 int height; 2088 int height, width;
2089 HBITMAP pixmap = 0; 2089 HBITMAP pixmap = 0;
2090 2090
2091 height = s->height - 2 * box_line_vwidth; 2091 height = s->height;
2092 if (s->slice.y == 0)
2093 height -= box_line_vwidth;
2094 if (s->slice.y + s->slice.height >= s->img->height)
2095 height -= box_line_vwidth;
2092 2096
2093 /* Fill background with face under the image. Do it only if row is 2097 /* Fill background with face under the image. Do it only if row is
2094 taller than image or if image has a clip mask to reduce 2098 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)
2101 || s->img->pixmap == 0 2105 || s->img->pixmap == 0
2102 || s->width != s->background_width) 2106 || s->width != s->background_width)
2103 { 2107 {
2108 width = s->background_width;
2104 x = s->x; 2109 x = s->x;
2105 if (s->first_glyph->left_box_line_p 2110 if (s->first_glyph->left_box_line_p
2106 && s->slice.x == 0) 2111 && s->slice.x == 0)
2107 x += box_line_hwidth; 2112 {
2113 x += box_line_hwidth;
2114 width -= box_line_hwidth;
2115 }
2108 2116
2109 y = s->y; 2117 y = s->y;
2110 if (s->slice.y == 0) 2118 if (s->slice.y == 0)
@@ -2150,7 +2158,7 @@ x_draw_image_glyph_string (struct glyph_string *s)
2150 } 2158 }
2151 else 2159 else
2152#endif 2160#endif
2153 x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); 2161 x_draw_glyph_string_bg_rect (s, x, y, width, height);
2154 2162
2155 s->background_filled_p = 1; 2163 s->background_filled_p = 1;
2156 } 2164 }