diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/w32term.c | 34 | ||||
| -rw-r--r-- | src/xterm.c | 32 |
3 files changed, 45 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4b5e56f5dc2..a6fabdccdea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief | ||
| 4 | display for sliced images (Bug#10500). | ||
| 5 | |||
| 6 | * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise. | ||
| 7 | |||
| 1 | 2012-11-30 Juanma Barranquero <lekktu@gmail.com> | 8 | 2012-11-30 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 9 | ||
| 3 | * doc.c (Fdocumentation): Re-add handling of function-documentation, | 10 | * doc.c (Fdocumentation): Re-add handling of function-documentation, |
diff --git a/src/w32term.c b/src/w32term.c index ab6afd32c75..84f99c090c8 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1738,8 +1738,8 @@ w32_draw_relief_rect (struct frame *f, | |||
| 1738 | if (left_p) | 1738 | if (left_p) |
| 1739 | for (i = 0; i < width; ++i) | 1739 | for (i = 0; i < width; ++i) |
| 1740 | w32_fill_area (f, hdc, gc.foreground, | 1740 | w32_fill_area (f, hdc, gc.foreground, |
| 1741 | left_x + i, top_y + i, 1, | 1741 | left_x + i, top_y + (i + 1) * top_p, 1, |
| 1742 | bottom_y - top_y - 2 * i + 1); | 1742 | bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1); |
| 1743 | 1743 | ||
| 1744 | if (raised_p) | 1744 | if (raised_p) |
| 1745 | gc.foreground = f->output_data.w32->black_relief.gc->foreground; | 1745 | gc.foreground = f->output_data.w32->black_relief.gc->foreground; |
| @@ -1757,8 +1757,8 @@ w32_draw_relief_rect (struct frame *f, | |||
| 1757 | if (right_p) | 1757 | if (right_p) |
| 1758 | for (i = 0; i < width; ++i) | 1758 | for (i = 0; i < width; ++i) |
| 1759 | w32_fill_area (f, hdc, gc.foreground, | 1759 | w32_fill_area (f, hdc, gc.foreground, |
| 1760 | right_x - i, top_y + i + 1, 1, | 1760 | right_x - i, top_y + (i + 1) * top_p, 1, |
| 1761 | bottom_y - top_y - 2 * i - 1); | 1761 | bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1); |
| 1762 | 1762 | ||
| 1763 | w32_set_clip_rectangle (hdc, NULL); | 1763 | w32_set_clip_rectangle (hdc, NULL); |
| 1764 | 1764 | ||
| @@ -1952,7 +1952,7 @@ x_draw_image_foreground (struct glyph_string *s) | |||
| 1952 | static void | 1952 | static void |
| 1953 | x_draw_image_relief (struct glyph_string *s) | 1953 | x_draw_image_relief (struct glyph_string *s) |
| 1954 | { | 1954 | { |
| 1955 | int x0, y0, x1, y1, thick, raised_p; | 1955 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; |
| 1956 | RECT r; | 1956 | RECT r; |
| 1957 | int x = s->x; | 1957 | int x = s->x; |
| 1958 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); | 1958 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| @@ -1984,19 +1984,23 @@ x_draw_image_relief (struct glyph_string *s) | |||
| 1984 | raised_p = s->img->relief > 0; | 1984 | raised_p = s->img->relief > 0; |
| 1985 | } | 1985 | } |
| 1986 | 1986 | ||
| 1987 | x0 = x - thick; | 1987 | x1 = x + s->slice.width - 1; |
| 1988 | y0 = y - thick; | 1988 | y1 = y + s->slice.height - 1; |
| 1989 | x1 = x + s->slice.width + thick - 1; | 1989 | top_p = bot_p = left_p = right_p = 0; |
| 1990 | y1 = y + s->slice.height + thick - 1; | 1990 | |
| 1991 | if (s->slice.x == 0) | ||
| 1992 | x -= thick, left_p = 1; | ||
| 1993 | if (s->slice.y == 0) | ||
| 1994 | y -= thick, top_p = 1; | ||
| 1995 | if (s->slice.x + s->slice.width == s->img->width) | ||
| 1996 | x1 += thick, right_p = 1; | ||
| 1997 | if (s->slice.y + s->slice.height == s->img->height) | ||
| 1998 | y1 += thick, bot_p = 1; | ||
| 1991 | 1999 | ||
| 1992 | x_setup_relief_colors (s); | 2000 | x_setup_relief_colors (s); |
| 1993 | get_glyph_string_clip_rect (s, &r); | 2001 | get_glyph_string_clip_rect (s, &r); |
| 1994 | w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, | 2002 | w32_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p, |
| 1995 | s->slice.y == 0, | 2003 | top_p, bot_p, left_p, right_p, &r); |
| 1996 | s->slice.y + s->slice.height == s->img->height, | ||
| 1997 | s->slice.x == 0, | ||
| 1998 | s->slice.x + s->slice.width == s->img->width, | ||
| 1999 | &r); | ||
| 2000 | } | 2004 | } |
| 2001 | 2005 | ||
| 2002 | 2006 | ||
diff --git a/src/xterm.c b/src/xterm.c index b5b8f03da48..8f7ed8ef561 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2022,7 +2022,8 @@ x_draw_relief_rect (struct frame *f, | |||
| 2022 | 2022 | ||
| 2023 | for (i = (width > 1 ? 1 : 0); i < width; ++i) | 2023 | for (i = (width > 1 ? 1 : 0); i < width; ++i) |
| 2024 | XDrawLine (dpy, window, gc, | 2024 | XDrawLine (dpy, window, gc, |
| 2025 | left_x + i, top_y + i, left_x + i, bottom_y - i + 1); | 2025 | left_x + i, top_y + (i + 1) * top_p, |
| 2026 | left_x + i, bottom_y + 1 - (i + 1) * bot_p); | ||
| 2026 | } | 2027 | } |
| 2027 | 2028 | ||
| 2028 | XSetClipMask (dpy, gc, None); | 2029 | XSetClipMask (dpy, gc, None); |
| @@ -2064,7 +2065,8 @@ x_draw_relief_rect (struct frame *f, | |||
| 2064 | XClearArea (dpy, window, right_x, bottom_y, 1, 1, False); | 2065 | XClearArea (dpy, window, right_x, bottom_y, 1, 1, False); |
| 2065 | for (i = 0; i < width; ++i) | 2066 | for (i = 0; i < width; ++i) |
| 2066 | XDrawLine (dpy, window, gc, | 2067 | XDrawLine (dpy, window, gc, |
| 2067 | right_x - i, top_y + i + 1, right_x - i, bottom_y - i); | 2068 | right_x - i, top_y + (i + 1) * top_p, |
| 2069 | right_x - i, bottom_y + 1 - (i + 1) * bot_p); | ||
| 2068 | } | 2070 | } |
| 2069 | 2071 | ||
| 2070 | XSetClipMask (dpy, gc, None); | 2072 | XSetClipMask (dpy, gc, None); |
| @@ -2258,7 +2260,7 @@ x_draw_image_foreground (struct glyph_string *s) | |||
| 2258 | static void | 2260 | static void |
| 2259 | x_draw_image_relief (struct glyph_string *s) | 2261 | x_draw_image_relief (struct glyph_string *s) |
| 2260 | { | 2262 | { |
| 2261 | int x0, y0, x1, y1, thick, raised_p; | 2263 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; |
| 2262 | int extra_x, extra_y; | 2264 | int extra_x, extra_y; |
| 2263 | XRectangle r; | 2265 | XRectangle r; |
| 2264 | int x = s->x; | 2266 | int x = s->x; |
| @@ -2304,19 +2306,23 @@ x_draw_image_relief (struct glyph_string *s) | |||
| 2304 | extra_x = extra_y = XINT (Vtool_bar_button_margin); | 2306 | extra_x = extra_y = XINT (Vtool_bar_button_margin); |
| 2305 | } | 2307 | } |
| 2306 | 2308 | ||
| 2307 | x0 = x - thick - extra_x; | 2309 | x1 = x + s->slice.width - 1; |
| 2308 | y0 = y - thick - extra_y; | 2310 | y1 = y + s->slice.height - 1; |
| 2309 | x1 = x + s->slice.width + thick - 1 + extra_x; | 2311 | top_p = bot_p = left_p = right_p = 0; |
| 2310 | y1 = y + s->slice.height + thick - 1 + extra_y; | 2312 | |
| 2313 | if (s->slice.x == 0) | ||
| 2314 | x -= thick, left_p = 1; | ||
| 2315 | if (s->slice.y == 0) | ||
| 2316 | y -= thick, top_p = 1; | ||
| 2317 | if (s->slice.x + s->slice.width == s->img->width) | ||
| 2318 | x1 += thick, right_p = 1; | ||
| 2319 | if (s->slice.y + s->slice.height == s->img->height) | ||
| 2320 | y1 += thick, bot_p = 1; | ||
| 2311 | 2321 | ||
| 2312 | x_setup_relief_colors (s); | 2322 | x_setup_relief_colors (s); |
| 2313 | get_glyph_string_clip_rect (s, &r); | 2323 | get_glyph_string_clip_rect (s, &r); |
| 2314 | x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, | 2324 | x_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p, |
| 2315 | s->slice.y == 0, | 2325 | top_p, bot_p, left_p, right_p, &r); |
| 2316 | s->slice.y + s->slice.height == s->img->height, | ||
| 2317 | s->slice.x == 0, | ||
| 2318 | s->slice.x + s->slice.width == s->img->width, | ||
| 2319 | &r); | ||
| 2320 | } | 2326 | } |
| 2321 | 2327 | ||
| 2322 | 2328 | ||