changeset 36800:7a809e9fc67e

(x_draw_glyph_string): Draw relief (if any) before drawing glyph string.
author Kenichi Handa <handa@m17n.org>
date Wed, 14 Mar 2001 13:18:05 +0000
parents d219e9d346c4
children 0d387c8ca7db
files src/xterm.c
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Wed Mar 14 13:15:51 2001 +0000
+++ b/src/xterm.c	Wed Mar 14 13:18:05 2001 +0000
@@ -4252,6 +4252,8 @@
 x_draw_glyph_string (s)
      struct glyph_string *s;
 {
+  int relief_drawn_p = 0;
+
   /* If S draws into the background of its successor, draw the
      background of the successor first so that S can draw into it.
      This makes S->next use XDrawString instead of XDrawImageString.  */
@@ -4267,6 +4269,19 @@
   x_set_glyph_string_gc (s);
   x_set_glyph_string_clipping (s);
 
+  /* Draw relief (if any) in advance for char/composition so that the
+     glyph string can be drawn over it.  */
+  if (!s->for_overlaps_p
+      && s->face->box != FACE_NO_BOX
+      && (s->first_glyph->type == CHAR_GLYPH
+	  || s->first_glyph->type == COMPOSITE_GLYPH))
+
+    {
+      x_draw_glyph_string_background (s, 1);
+      x_draw_glyph_string_box (s);
+      relief_drawn_p = 1;
+    }
+
   switch (s->first_glyph->type)
     {
     case IMAGE_GLYPH:
@@ -4377,8 +4392,8 @@
 	    }
 	}
   
-      /* Draw relief.  */
-      if (s->face->box != FACE_NO_BOX)
+      /* Draw relief if not yet drawn.  */
+      if (!relief_drawn_p && s->face->box != FACE_NO_BOX)
 	x_draw_glyph_string_box (s);
     }