From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: 17115@debbugs.gnu.org
Subject: bug#17115: 24.3.50; possible bug in drawing images with box on W32
Date: Thu, 27 Mar 2014 11:42:09 +0900 [thread overview]
Message-ID: <wlr45ojrb2.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
Recently I found a bug (which is different from Bug#17114) in drawing
images with box on the Mac port, and I suspect it also happens on W32
because their code are similar (though I can't test it). Could
someone try if it is reproducible on W32 and if so, please try the
patch at the end?
Steps to reproduce:
1. $ emacs -Q -D &
2. (insert-image (create-image "splash.png")
(propertize " " 'face '(:box (:line-width 5)))) C-j
3. C-p C-p
Result:
The left half of the character `t' just after the image gets erased.
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
=== modified file 'src/w32term.c'
*** src/w32term.c 2014-03-26 15:57:13 +0000
--- src/w32term.c 2014-03-27 02:32:46 +0000
***************
*** 2082,2094 ****
static void
x_draw_image_glyph_string (struct glyph_string *s)
{
- int x, y;
int box_line_hwidth = eabs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
HBITMAP pixmap = 0;
! height = s->height - 2 * box_line_vwidth;
/* Fill background with face under the image. Do it only if row is
taller than image or if image has a clip mask to reduce
--- 2082,2097 ----
static void
x_draw_image_glyph_string (struct glyph_string *s)
{
int box_line_hwidth = eabs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
HBITMAP pixmap = 0;
! height = s->height;
! if (s->slice.y == 0)
! height -= box_line_vwidth;
! if (s->slice.y + s->slice.height >= s->img->height)
! height -= box_line_vwidth;
/* Fill background with face under the image. Do it only if row is
taller than image or if image has a clip mask to reduce
***************
*** 2101,2112 ****
|| s->img->pixmap == 0
|| s->width != s->background_width)
{
! x = s->x;
if (s->first_glyph->left_box_line_p
&& s->slice.x == 0)
! x += box_line_hwidth;
- y = s->y;
if (s->slice.y == 0)
y += box_line_vwidth;
--- 2104,2120 ----
|| s->img->pixmap == 0
|| s->width != s->background_width)
{
! int x = s->x;
! int y = s->y;
! int width = s->background_width;
!
if (s->first_glyph->left_box_line_p
&& s->slice.x == 0)
! {
! x += box_line_hwidth;
! width -= box_line_hwidth;
! }
if (s->slice.y == 0)
y += box_line_vwidth;
***************
*** 2150,2156 ****
}
else
#endif
! x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
s->background_filled_p = 1;
}
--- 2158,2164 ----
}
else
#endif
! x_draw_glyph_string_bg_rect (s, x, y, width, height);
s->background_filled_p = 1;
}
next reply other threads:[~2014-03-27 2:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 2:42 YAMAMOTO Mitsuharu [this message]
2014-03-27 4:48 ` bug#17115: 24.3.50; possible bug in drawing images with box on W32 YAMAMOTO Mitsuharu
2014-03-27 16:29 ` Eli Zaretskii
2014-03-28 0:54 ` YAMAMOTO Mitsuharu
2014-03-28 7:25 ` Eli Zaretskii
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=wlr45ojrb2.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=17115@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.