better centering for drawtext()

This commit is contained in:
Martin Stubenschrott 2007-10-16 19:20:39 +02:00 committed by Julien Danjou
parent 472b07f8ab
commit b333185ec1
1 changed files with 1 additions and 1 deletions

2
draw.c
View File

@ -67,7 +67,7 @@ drawtext(Display *disp, int screen, int x, int y, int w, int h, Drawable drawabl
buf[len - 3] = '.';
}
cairo_move_to(cr, x + font->height / 2, y + font->height);
cairo_move_to(cr, x + font->height / 2, y + font->ascent + (dh - font->height) / 2);
cairo_show_text(cr, buf);
cairo_font_face_destroy(font_face);