emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107372: * src/xterm.c (x_draw_image_


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107372: * src/xterm.c (x_draw_image_relief): Add missing type check for Vtool_bar_button_margin.
Date: Wed, 22 Feb 2012 14:03:30 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107372
fixes bug(s): http://debbugs.gnu.org/10743
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2012-02-22 14:03:30 +0800
message:
  * src/xterm.c (x_draw_image_relief): Add missing type check for 
Vtool_bar_button_margin.
modified:
  src/ChangeLog
  src/xterm.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-02-21 13:24:48 +0000
+++ b/src/ChangeLog     2012-02-22 06:03:30 +0000
@@ -1,3 +1,8 @@
+2012-02-22  Chong Yidong  <address@hidden>
+
+       * xterm.c (x_draw_image_relief): Add missing type check for
+       Vtool_bar_button_margin (Bug#10743).
+
 2012-02-21  Chong Yidong  <address@hidden>
 
        * fileio.c (Vfile_name_handler_alist): Doc fix.

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2012-02-02 02:12:57 +0000
+++ b/src/xterm.c       2012-02-22 06:03:30 +0000
@@ -2292,7 +2292,8 @@
 static void
 x_draw_image_relief (struct glyph_string *s)
 {
-  int x0, y0, x1, y1, thick, raised_p, extra;
+  int x0, y0, x1, y1, thick, raised_p;
+  int extra_x, extra_y;
   XRectangle r;
   int x = s->x;
   int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -2323,13 +2324,24 @@
       raised_p = s->img->relief > 0;
     }
 
-  extra = s->face->id == TOOL_BAR_FACE_ID
-    ? XINT (Vtool_bar_button_margin) : 0;
+  extra_x = extra_y = 0;
+  if (s->face->id == TOOL_BAR_FACE_ID)
+    {
+      if (CONSP (Vtool_bar_button_margin)
+         && INTEGERP (XCAR (Vtool_bar_button_margin))
+         && INTEGERP (XCDR (Vtool_bar_button_margin)))
+       {
+         extra_x = XCAR (Vtool_bar_button_margin);
+         extra_y = XCDR (Vtool_bar_button_margin);
+       }
+      else if (INTEGERP (Vtool_bar_button_margin))
+       extra_x = extra_y = XINT (Vtool_bar_button_margin);
+    }
 
-  x0 = x - thick - extra;
-  y0 = y - thick - extra;
-  x1 = x + s->slice.width + thick - 1 + extra;
-  y1 = y + s->slice.height + thick - 1 + extra;
+  x0 = x - thick - extra_x;
+  y0 = y - thick - extra_y;
+  x1 = x + s->slice.width + thick - 1 + extra_x;
+  y1 = y + s->slice.height + thick - 1 + extra_y;
 
   x_setup_relief_colors (s);
   get_glyph_string_clip_rect (s, &r);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]