Fixes problem with y offset and right/center alignment
This commit is contained in:
parent
6be47235d4
commit
2f7408e848
3
bar.c
3
bar.c
|
@ -181,7 +181,6 @@ draw_char (monitor_t *mon, font_t *cur_font, int x, int align, wchar_t ch)
|
||||||
} else {
|
} else {
|
||||||
ch_width = cur_font->width_lut[ch - cur_font->char_min].character_width;
|
ch_width = cur_font->width_lut[ch - cur_font->char_min].character_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (align) {
|
switch (align) {
|
||||||
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,
|
||||||
|
@ -196,7 +195,7 @@ draw_char (monitor_t *mon, font_t *cur_font, int x, int align, wchar_t ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Draw the background first */
|
/* Draw the background first */
|
||||||
fill_rect(mon->pixmap, gc[GC_CLEAR], x, by, ch_width, bh);
|
fill_rect(mon->pixmap, gc[GC_CLEAR], x, 0, ch_width, bh);
|
||||||
|
|
||||||
int y = bh / 2 + cur_font->height / 2- cur_font->descent;
|
int y = bh / 2 + cur_font->height / 2- cur_font->descent;
|
||||||
if (cur_font->xft_ft) {
|
if (cur_font->xft_ft) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user