diff options
| author | YAMAMOTO Mitsuharu | 2014-03-21 19:14:10 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2014-03-21 19:14:10 +0900 |
| commit | fef27dc1ad8e5b3fe4d11bf0c7711151d4c8ada8 (patch) | |
| tree | b298fb754fe8f8a1d4414d11254f4d4c61f8efa8 /src | |
| parent | 21e18b30e2a15b726b9822cb7bb086792465a6d1 (diff) | |
| download | emacs-fef27dc1ad8e5b3fe4d11bf0c7711151d4c8ada8.tar.gz emacs-fef27dc1ad8e5b3fe4d11bf0c7711151d4c8ada8.zip | |
Fix regression introduced by patch for Bug#10500.
* xterm.c (x_draw_image_relief): Respect Vtool_bar_button_margin.
* w32term.c (x_draw_image_relief): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/w32term.c | 24 | ||||
| -rw-r--r-- | src/xterm.c | 24 |
3 files changed, 46 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ccd8fb46957..dbfb1436fe1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-03-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | Fix regression introduced by patch for Bug#10500. | ||
| 4 | * xterm.c (x_draw_image_relief): Respect Vtool_bar_button_margin. | ||
| 5 | * w32term.c (x_draw_image_relief): Likewise. | ||
| 6 | |||
| 1 | 2014-03-21 Martin Rudalics <rudalics@gmx.at> | 7 | 2014-03-21 Martin Rudalics <rudalics@gmx.at> |
| 2 | 8 | ||
| 3 | * w32fns.c (w32_wnd_proc): For WM_WINDOWPOSCHANGING don't | 9 | * w32fns.c (w32_wnd_proc): For WM_WINDOWPOSCHANGING don't |
diff --git a/src/w32term.c b/src/w32term.c index ac8f9a2092d..15b502b7c1b 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1892,6 +1892,7 @@ static void | |||
| 1892 | x_draw_image_relief (struct glyph_string *s) | 1892 | x_draw_image_relief (struct glyph_string *s) |
| 1893 | { | 1893 | { |
| 1894 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; | 1894 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; |
| 1895 | int extra_x, extra_y; | ||
| 1895 | RECT r; | 1896 | RECT r; |
| 1896 | int x = s->x; | 1897 | int x = s->x; |
| 1897 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); | 1898 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| @@ -1925,16 +1926,31 @@ x_draw_image_relief (struct glyph_string *s) | |||
| 1925 | 1926 | ||
| 1926 | x1 = x + s->slice.width - 1; | 1927 | x1 = x + s->slice.width - 1; |
| 1927 | y1 = y + s->slice.height - 1; | 1928 | y1 = y + s->slice.height - 1; |
| 1929 | |||
| 1930 | extra_x = extra_y = 0; | ||
| 1931 | if (s->face->id == TOOL_BAR_FACE_ID) | ||
| 1932 | { | ||
| 1933 | if (CONSP (Vtool_bar_button_margin) | ||
| 1934 | && INTEGERP (XCAR (Vtool_bar_button_margin)) | ||
| 1935 | && INTEGERP (XCDR (Vtool_bar_button_margin))) | ||
| 1936 | { | ||
| 1937 | extra_x = XINT (XCAR (Vtool_bar_button_margin)); | ||
| 1938 | extra_y = XINT (XCDR (Vtool_bar_button_margin)); | ||
| 1939 | } | ||
| 1940 | else if (INTEGERP (Vtool_bar_button_margin)) | ||
| 1941 | extra_x = extra_y = XINT (Vtool_bar_button_margin); | ||
| 1942 | } | ||
| 1943 | |||
| 1928 | top_p = bot_p = left_p = right_p = 0; | 1944 | top_p = bot_p = left_p = right_p = 0; |
| 1929 | 1945 | ||
| 1930 | if (s->slice.x == 0) | 1946 | if (s->slice.x == 0) |
| 1931 | x -= thick, left_p = 1; | 1947 | x -= thick + extra_x, left_p = 1; |
| 1932 | if (s->slice.y == 0) | 1948 | if (s->slice.y == 0) |
| 1933 | y -= thick, top_p = 1; | 1949 | y -= thick + extra_y, top_p = 1; |
| 1934 | if (s->slice.x + s->slice.width == s->img->width) | 1950 | if (s->slice.x + s->slice.width == s->img->width) |
| 1935 | x1 += thick, right_p = 1; | 1951 | x1 += thick + extra_x, right_p = 1; |
| 1936 | if (s->slice.y + s->slice.height == s->img->height) | 1952 | if (s->slice.y + s->slice.height == s->img->height) |
| 1937 | y1 += thick, bot_p = 1; | 1953 | y1 += thick + extra_y, bot_p = 1; |
| 1938 | 1954 | ||
| 1939 | x_setup_relief_colors (s); | 1955 | x_setup_relief_colors (s); |
| 1940 | get_glyph_string_clip_rect (s, &r); | 1956 | get_glyph_string_clip_rect (s, &r); |
diff --git a/src/xterm.c b/src/xterm.c index 1136b671822..fc61fb248ef 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2162,6 +2162,7 @@ static void | |||
| 2162 | x_draw_image_relief (struct glyph_string *s) | 2162 | x_draw_image_relief (struct glyph_string *s) |
| 2163 | { | 2163 | { |
| 2164 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; | 2164 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; |
| 2165 | int extra_x, extra_y; | ||
| 2165 | XRectangle r; | 2166 | XRectangle r; |
| 2166 | int x = s->x; | 2167 | int x = s->x; |
| 2167 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); | 2168 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| @@ -2194,16 +2195,31 @@ x_draw_image_relief (struct glyph_string *s) | |||
| 2194 | 2195 | ||
| 2195 | x1 = x + s->slice.width - 1; | 2196 | x1 = x + s->slice.width - 1; |
| 2196 | y1 = y + s->slice.height - 1; | 2197 | y1 = y + s->slice.height - 1; |
| 2198 | |||
| 2199 | extra_x = extra_y = 0; | ||
| 2200 | if (s->face->id == TOOL_BAR_FACE_ID) | ||
| 2201 | { | ||
| 2202 | if (CONSP (Vtool_bar_button_margin) | ||
| 2203 | && INTEGERP (XCAR (Vtool_bar_button_margin)) | ||
| 2204 | && INTEGERP (XCDR (Vtool_bar_button_margin))) | ||
| 2205 | { | ||
| 2206 | extra_x = XINT (XCAR (Vtool_bar_button_margin)); | ||
| 2207 | extra_y = XINT (XCDR (Vtool_bar_button_margin)); | ||
| 2208 | } | ||
| 2209 | else if (INTEGERP (Vtool_bar_button_margin)) | ||
| 2210 | extra_x = extra_y = XINT (Vtool_bar_button_margin); | ||
| 2211 | } | ||
| 2212 | |||
| 2197 | top_p = bot_p = left_p = right_p = 0; | 2213 | top_p = bot_p = left_p = right_p = 0; |
| 2198 | 2214 | ||
| 2199 | if (s->slice.x == 0) | 2215 | if (s->slice.x == 0) |
| 2200 | x -= thick, left_p = 1; | 2216 | x -= thick + extra_x, left_p = 1; |
| 2201 | if (s->slice.y == 0) | 2217 | if (s->slice.y == 0) |
| 2202 | y -= thick, top_p = 1; | 2218 | y -= thick + extra_y, top_p = 1; |
| 2203 | if (s->slice.x + s->slice.width == s->img->width) | 2219 | if (s->slice.x + s->slice.width == s->img->width) |
| 2204 | x1 += thick, right_p = 1; | 2220 | x1 += thick + extra_x, right_p = 1; |
| 2205 | if (s->slice.y + s->slice.height == s->img->height) | 2221 | if (s->slice.y + s->slice.height == s->img->height) |
| 2206 | y1 += thick, bot_p = 1; | 2222 | y1 += thick + extra_y, bot_p = 1; |
| 2207 | 2223 | ||
| 2208 | x_setup_relief_colors (s); | 2224 | x_setup_relief_colors (s); |
| 2209 | get_glyph_string_clip_rect (s, &r); | 2225 | get_glyph_string_clip_rect (s, &r); |