- let callers of font_draw figure out (and pass) the color instead of an
'active' flag. - use strlen() inside of font_draw; the only instance where it wasn't used happened to be ignored on a subsequent draw.
This commit is contained in:
9
font.c
9
font.c
@@ -75,13 +75,10 @@ font_width(XftFont *xftfont, const char *text, int len)
|
||||
}
|
||||
|
||||
void
|
||||
font_draw(struct screen_ctx *sc, const char *text, int len,
|
||||
Drawable d, int active, int x, int y)
|
||||
font_draw(struct screen_ctx *sc, const char *text,
|
||||
Drawable d, int color, int x, int y)
|
||||
{
|
||||
int color;
|
||||
|
||||
color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
|
||||
XftDrawChange(sc->xftdraw, d);
|
||||
XftDrawStringUtf8(sc->xftdraw, &sc->xftcolor[color], sc->xftfont, x, y,
|
||||
(const FcChar8*)text, len);
|
||||
(const FcChar8*)text, strlen(text));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user