diff options
| author | Chong Yidong | 2012-02-22 14:03:30 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-02-22 14:03:30 +0800 |
| commit | 86b847b644525b83ea218bc7b6ed2de73beaced6 (patch) | |
| tree | f79823258f3ab2f379b7b33922ca79f530636cb4 /src | |
| parent | f25aef2e1e79cdd0cb1007bb1078d6894ebc4aeb (diff) | |
| download | emacs-86b847b644525b83ea218bc7b6ed2de73beaced6.tar.gz emacs-86b847b644525b83ea218bc7b6ed2de73beaced6.zip | |
* src/xterm.c (x_draw_image_relief): Add missing type check for Vtool_bar_button_margin.
Fixes: debbugs:10743
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xterm.c | 26 |
2 files changed, 24 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c5e898684a8..5a376c4ad5b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-02-22 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * xterm.c (x_draw_image_relief): Add missing type check for | ||
| 4 | Vtool_bar_button_margin (Bug#10743). | ||
| 5 | |||
| 1 | 2012-02-21 Chong Yidong <cyd@gnu.org> | 6 | 2012-02-21 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * fileio.c (Vfile_name_handler_alist): Doc fix. | 8 | * fileio.c (Vfile_name_handler_alist): Doc fix. |
diff --git a/src/xterm.c b/src/xterm.c index 0a54c987387..6a5798661fa 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2292,7 +2292,8 @@ x_draw_image_foreground (struct glyph_string *s) | |||
| 2292 | static void | 2292 | static void |
| 2293 | x_draw_image_relief (struct glyph_string *s) | 2293 | x_draw_image_relief (struct glyph_string *s) |
| 2294 | { | 2294 | { |
| 2295 | int x0, y0, x1, y1, thick, raised_p, extra; | 2295 | int x0, y0, x1, y1, thick, raised_p; |
| 2296 | int extra_x, extra_y; | ||
| 2296 | XRectangle r; | 2297 | XRectangle r; |
| 2297 | int x = s->x; | 2298 | int x = s->x; |
| 2298 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); | 2299 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| @@ -2323,13 +2324,24 @@ x_draw_image_relief (struct glyph_string *s) | |||
| 2323 | raised_p = s->img->relief > 0; | 2324 | raised_p = s->img->relief > 0; |
| 2324 | } | 2325 | } |
| 2325 | 2326 | ||
| 2326 | extra = s->face->id == TOOL_BAR_FACE_ID | 2327 | extra_x = extra_y = 0; |
| 2327 | ? XINT (Vtool_bar_button_margin) : 0; | 2328 | if (s->face->id == TOOL_BAR_FACE_ID) |
| 2329 | { | ||
| 2330 | if (CONSP (Vtool_bar_button_margin) | ||
| 2331 | && INTEGERP (XCAR (Vtool_bar_button_margin)) | ||
| 2332 | && INTEGERP (XCDR (Vtool_bar_button_margin))) | ||
| 2333 | { | ||
| 2334 | extra_x = XCAR (Vtool_bar_button_margin); | ||
| 2335 | extra_y = XCDR (Vtool_bar_button_margin); | ||
| 2336 | } | ||
| 2337 | else if (INTEGERP (Vtool_bar_button_margin)) | ||
| 2338 | extra_x = extra_y = XINT (Vtool_bar_button_margin); | ||
| 2339 | } | ||
| 2328 | 2340 | ||
| 2329 | x0 = x - thick - extra; | 2341 | x0 = x - thick - extra_x; |
| 2330 | y0 = y - thick - extra; | 2342 | y0 = y - thick - extra_y; |
| 2331 | x1 = x + s->slice.width + thick - 1 + extra; | 2343 | x1 = x + s->slice.width + thick - 1 + extra_x; |
| 2332 | y1 = y + s->slice.height + thick - 1 + extra; | 2344 | y1 = y + s->slice.height + thick - 1 + extra_y; |
| 2333 | 2345 | ||
| 2334 | x_setup_relief_colors (s); | 2346 | x_setup_relief_colors (s); |
| 2335 | get_glyph_string_clip_rect (s, &r); | 2347 | get_glyph_string_clip_rect (s, &r); |