From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: 10500@debbugs.gnu.org
Subject: bug#10500: 23.3.50; wrong relief display for sliced images
Date: Sat, 14 Jan 2012 13:46:07 +0900 [thread overview]
Message-ID: <wlr4z299io.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
You can observe that the image reliefs are displayed unclipped in the
following examples for sliced images:
(dolist
(image
(list (create-image "splash.png" nil nil :relief 10 :background "gray75")
(create-image "splash.png" nil nil :ascent 10 :relief 10 :background "gray75")
(create-image "splash.png" nil nil :ascent 100 :relief 10 :background "gray75")))
(dotimes (i 3)
(dotimes (j 3)
(insert-image image nil nil (list (* j 100) (* i 80) 100 80))
(insert "spacer"))
(newline)))
I created a patch below for X11 and tried porting it for W32, but I
can't test it the latter.
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Users/mituharu/src/bzr/emacs/emacs-23/etc/DEBUG.
In GNU Emacs 23.3.50.1 (x86_64-apple-darwin11.2.0, X toolkit)
of 2012-01-14 on yamamoto-no-iMac.local
Windowing system distributor `The X.Org Foundation', version 11.0.11003000
configured using `configure '--with-jpeg=no' '--with-gif=no' '--with-tiff=no''
=== modified file 'src/w32term.c'
*** src/w32term.c 2012-01-11 07:52:35 +0000
--- src/w32term.c 2012-01-14 03:47:31 +0000
***************
*** 1657,1664 ****
if (left_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
! left_x + i, top_y + i, 1,
! bottom_y - top_y - 2 * i + 1);
if (raised_p)
gc.foreground = f->output_data.w32->black_relief.gc->foreground;
--- 1657,1664 ----
if (left_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
! left_x + i, top_y + (i + 1) * top_p, 1,
! bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
if (raised_p)
gc.foreground = f->output_data.w32->black_relief.gc->foreground;
***************
*** 1676,1683 ****
if (right_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
! right_x - i, top_y + i + 1, 1,
! bottom_y - top_y - 2 * i - 1);
w32_set_clip_rectangle (hdc, NULL);
--- 1676,1683 ----
if (right_p)
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
! right_x - i, top_y + (i + 1) * top_p, 1,
! bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
w32_set_clip_rectangle (hdc, NULL);
***************
*** 1876,1882 ****
x_draw_image_relief (s)
struct glyph_string *s;
{
! int x0, y0, x1, y1, thick, raised_p;
RECT r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
--- 1876,1882 ----
x_draw_image_relief (s)
struct glyph_string *s;
{
! int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
RECT r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
***************
*** 1907,1925 ****
raised_p = s->img->relief > 0;
}
! x0 = x - thick;
! y0 = y - thick;
! x1 = x + s->slice.width + thick - 1;
! y1 = y + s->slice.height + thick - 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
! w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
! s->slice.y == 0,
! s->slice.y + s->slice.height == s->img->height,
! s->slice.x == 0,
! s->slice.x + s->slice.width == s->img->width,
! &r);
}
--- 1907,1929 ----
raised_p = s->img->relief > 0;
}
! x1 = x + s->slice.width - 1;
! y1 = y + s->slice.height - 1;
! top_p = bot_p = left_p = right_p = 0;
!
! if (s->slice.x == 0)
! x -= thick, left_p = 1;
! if (s->slice.y == 0)
! y -= thick, top_p = 1;
! if (s->slice.x + s->slice.width == s->img->width)
! x1 += thick, right_p = 1;
! if (s->slice.y + s->slice.height == s->img->height)
! y1 += thick, bot_p = 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
! w32_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p,
! top_p, bot_p, left_p, right_p, &r);
}
=== modified file 'src/xterm.c'
*** src/xterm.c 2012-01-11 07:52:35 +0000
--- src/xterm.c 2012-01-14 03:21:46 +0000
***************
*** 2060,2066 ****
if (left_p)
for (i = 0; i < width; ++i)
XDrawLine (dpy, window, gc,
! left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
XSetClipMask (dpy, gc, None);
if (raised_p)
--- 2060,2067 ----
if (left_p)
for (i = 0; i < width; ++i)
XDrawLine (dpy, window, gc,
! left_x + i, top_y + (i + 1) * top_p,
! left_x + i, bottom_y + 1 - (i + 1) * bot_p);
XSetClipMask (dpy, gc, None);
if (raised_p)
***************
*** 2080,2086 ****
if (right_p)
for (i = 0; i < width; ++i)
XDrawLine (dpy, window, gc,
! right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
XSetClipMask (dpy, gc, None);
}
--- 2081,2088 ----
if (right_p)
for (i = 0; i < width; ++i)
XDrawLine (dpy, window, gc,
! right_x - i, top_y + (i + 1) * top_p,
! right_x - i, bottom_y + 1 - (i + 1) * bot_p);
XSetClipMask (dpy, gc, None);
}
***************
*** 2278,2284 ****
x_draw_image_relief (s)
struct glyph_string *s;
{
! int x0, y0, x1, y1, thick, raised_p;
XRectangle r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
--- 2280,2286 ----
x_draw_image_relief (s)
struct glyph_string *s;
{
! int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
XRectangle r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
***************
*** 2309,2327 ****
raised_p = s->img->relief > 0;
}
! x0 = x - thick;
! y0 = y - thick;
! x1 = x + s->slice.width + thick - 1;
! y1 = y + s->slice.height + thick - 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
! x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
! s->slice.y == 0,
! s->slice.y + s->slice.height == s->img->height,
! s->slice.x == 0,
! s->slice.x + s->slice.width == s->img->width,
! &r);
}
--- 2311,2333 ----
raised_p = s->img->relief > 0;
}
! x1 = x + s->slice.width - 1;
! y1 = y + s->slice.height - 1;
! top_p = bot_p = left_p = right_p = 0;
!
! if (s->slice.x == 0)
! x -= thick, left_p = 1;
! if (s->slice.y == 0)
! y -= thick, top_p = 1;
! if (s->slice.x + s->slice.width == s->img->width)
! x1 += thick, right_p = 1;
! if (s->slice.y + s->slice.height == s->img->height)
! y1 += thick, bot_p = 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
! x_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p,
! top_p, bot_p, left_p, right_p, &r);
}
next reply other threads:[~2012-01-14 4:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-14 4:46 YAMAMOTO Mitsuharu [this message]
2012-12-01 2:38 ` bug#10500: 23.3.50; wrong relief display for sliced images Chong Yidong
2012-12-01 9:18 ` Eli Zaretskii
2012-12-01 23:14 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlr4z299io.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=10500@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.