Flawless centering

This commit is contained in:
LemonBoy 2014-03-15 15:07:10 +00:00
parent 10d1a15c2d
commit 3919a0045c

2
bar.c
View File

@ -108,7 +108,7 @@ draw_char (monitor_t *mon, font_t *cur_font, int x, int align, uint16_t ch)
case ALIGN_C: case ALIGN_C:
xcb_copy_area(c, mon->pixmap, mon->pixmap, gc[GC_DRAW], mon->width / 2 - x / 2, 0, xcb_copy_area(c, mon->pixmap, mon->pixmap, gc[GC_DRAW], mon->width / 2 - x / 2, 0,
mon->width / 2 - (x + ch_width) / 2, 0, x, bh); mon->width / 2 - (x + ch_width) / 2, 0, x, bh);
x = mon->width / 2 - ch_width / 2 + x / 2; x = mon->width / 2 - (x + ch_width) / 2 + x;
break; break;
case ALIGN_R: case ALIGN_R:
xcb_copy_area(c, mon->pixmap, mon->pixmap, gc[GC_DRAW], mon->width - x, 0, xcb_copy_area(c, mon->pixmap, mon->pixmap, gc[GC_DRAW], mon->width - x, 0,