From 14beabe55fa3cac03f598e138f363f1d50659564 Mon Sep 17 00:00:00 2001 From: Shawn Betts Date: Sat, 4 Jul 2009 20:58:21 -0700 Subject: fix inverted text when using xft Now the inverted rectangle is drawn first and the text overtop in the bg color. --- src/globals.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/globals.c') diff --git a/src/globals.c b/src/globals.c index f21195f..7446bca 100644 --- a/src/globals.c +++ b/src/globals.c @@ -272,7 +272,7 @@ init_globals (void) /* Wrapper font functions to support Xft */ void -rp_draw_string (rp_screen *s, Drawable d, GC gc, int x, int y, char *string, int length) +rp_draw_string (rp_screen *s, Drawable d, int style, int x, int y, char *string, int length) { if (length < 0) length = strlen (string); @@ -285,7 +285,7 @@ rp_draw_string (rp_screen *s, Drawable d, GC gc, int x, int y, char *string, int DefaultColormap (dpy, s->screen_num)); if (draw) { - XftDrawString8 (draw, &s->xft_color, s->xft_font, x, y, (FcChar8*) string, length); + XftDrawString8 (draw, style == STYLE_NORMAL ? &s->xft_fg_color:&s->xft_bg_color, s->xft_font, x, y, (FcChar8*) string, length); XftDrawDestroy (draw); } else @@ -293,7 +293,7 @@ rp_draw_string (rp_screen *s, Drawable d, GC gc, int x, int y, char *string, int } else #endif - XmbDrawString (dpy, d, defaults.font, gc, x, y, string, length); + XmbDrawString (dpy, d, defaults.font, style == STYLE_NORMAL ? s->normal_gc:s->inverse_gc, x, y, string, length); } int -- cgit v1.2.3