From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#17115: 24.3.50; possible bug in drawing images with box on W32 Date: Thu, 27 Mar 2014 11:42:09 +0900 Organization: Faculty of Science, Chiba University Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1395888194 10244 80.91.229.3 (27 Mar 2014 02:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Mar 2014 02:43:14 +0000 (UTC) To: 17115@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 27 03:43:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WT0Hp-0007kR-7k for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Mar 2014 03:43:21 +0100 Original-Received: from localhost ([::1]:51293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT0Ho-0007ES-TC for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Mar 2014 22:43:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT0He-0007Cy-FY for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 22:43:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WT0HX-00081u-Gc for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 22:43:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT0HX-00081i-E6 for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 22:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WT0HW-0003vG-Kw for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 22:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Mar 2014 02:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17115 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139588816015044 (code B ref -1); Thu, 27 Mar 2014 02:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Mar 2014 02:42:40 +0000 Original-Received: from localhost ([127.0.0.1]:51589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WT0H9-0003uZ-7h for submit@debbugs.gnu.org; Wed, 26 Mar 2014 22:42:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58592) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WT0H3-0003uO-MC for submit@debbugs.gnu.org; Wed, 26 Mar 2014 22:42:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WT0Gw-0007Rs-9h for submit@debbugs.gnu.org; Wed, 26 Mar 2014 22:42:33 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT0Gw-0007Ro-7Z for submit@debbugs.gnu.org; Wed, 26 Mar 2014 22:42:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT0Gq-0006uq-5z for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 22:42:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WT0Gk-0007Mm-1G for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 22:42:20 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:58262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WT0Gj-0007Lu-Fr for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 22:42:13 -0400 Original-Received: from fermat.math.s.chiba-u.ac.jp (fermat [133.82.132.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id E755DC055D for ; Thu, 27 Mar 2014 11:42:09 +0900 (JST) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?UTF-8?Q?Shij=C5=8D?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87438 Archived-At: 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; }