GNU bug report logs - #10500
23.3.50; wrong relief display for sliced images

Previous Next

Package: emacs;

Reported by: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Date: Sat, 14 Jan 2012 04:47:02 UTC

Severity: normal

Tags: patch

Found in version 23.3.50

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10500 in the body.
You can then email your comments to 10500 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10500; Package emacs. (Sat, 14 Jan 2012 04:47:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 14 Jan 2012 04:47:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.3.50; wrong relief display for sliced images
Date: Sat, 14 Jan 2012 13:46:07 +0900
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 <at> 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);
  }
  
  





Added tag(s) patch. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Tue, 17 Jan 2012 03:57:02 GMT) Full text and rfc822 format available.

Reply sent to Chong Yidong <cyd <at> gnu.org>:
You have taken responsibility. (Sat, 01 Dec 2012 02:41:02 GMT) Full text and rfc822 format available.

Notification sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
bug acknowledged by developer. (Sat, 01 Dec 2012 02:41:02 GMT) Full text and rfc822 format available.

Message #12 received at 10500-done <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: 10500-done <at> debbugs.gnu.org
Subject: Re: bug#10500: 23.3.50; wrong relief display for sliced images
Date: Sat, 01 Dec 2012 10:38:10 +0800
YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp> writes:

> You can observe that the image reliefs are displayed unclipped in the
> following examples for sliced images:
>
> I created a patch below for X11 and tried porting it for W32, but I
> can't test it the latter.

Thanks, I went ahead and committed your patch to trunk.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10500; Package emacs. (Sat, 01 Dec 2012 09:22:01 GMT) Full text and rfc822 format available.

Message #15 received at 10500 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chong Yidong <cyd <at> gnu.org>
Cc: 10500 <at> debbugs.gnu.org, mituharu <at> math.s.chiba-u.ac.jp, cyd <at> gnu.org
Subject: Re: bug#10500: 23.3.50; wrong relief display for sliced images
Date: Sat, 01 Dec 2012 11:18:48 +0200
> From: Chong Yidong <cyd <at> gnu.org>
> Date: Sat, 01 Dec 2012 10:38:10 +0800
> Cc: 10500-done <at> debbugs.gnu.org
> 
> YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp> writes:
> 
> > You can observe that the image reliefs are displayed unclipped in the
> > following examples for sliced images:
> >
> > I created a patch below for X11 and tried porting it for W32, but I
> > can't test it the latter.
> 
> Thanks, I went ahead and committed your patch to trunk.

It's hard for me to say whether the changes work correctly on
MS-Windows, since there was no image attached to the bug report to
show the correct and the incorrect display.  But at least the changes
compile on Windows and I do see a difference in the way the test case
is displayed before and after the change.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10500; Package emacs. (Sat, 01 Dec 2012 23:17:01 GMT) Full text and rfc822 format available.

Message #18 received at 10500 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 10500 <at> debbugs.gnu.org
Subject: Re: Bug#10500: 23.3.50; wrong relief display for sliced images
Date: Sat, 01 Dec 2012 17:14:25 -0600
As installed in trunk bzr 111050, that patch caused the
local variables extra_x and extra_y to be unused.
I assume these variables are no longer needed, so I
removed them in trunk bzr 111059.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 Dec 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 127 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.