Task, Button: add a bit of slack in the pango text layout, to avoid wrapping due to rounding errors

This commit is contained in:
o9000 2017-12-28 09:14:02 +01:00
parent 1b48efe738
commit 457d51e267
2 changed files with 2 additions and 2 deletions

View file

@ -460,7 +460,7 @@ void draw_button(void *obj, cairo_t *c)
PangoLayout *layout = pango_cairo_create_layout(c);
pango_layout_set_font_description(layout, button->backend->font_desc);
pango_layout_set_width(layout, button->frontend->textw * PANGO_SCALE);
pango_layout_set_width(layout, (button->frontend->textw + 1) * PANGO_SCALE);
pango_layout_set_alignment(layout, button->backend->centered ? PANGO_ALIGN_CENTER : PANGO_ALIGN_LEFT);
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE);

View file

@ -463,7 +463,7 @@ void draw_task(void *obj, cairo_t *c)
pango_layout_set_font_description(layout, panel->g_task.font_desc);
pango_layout_set_text(layout, task->title, -1);
pango_layout_set_width(layout, ((Taskbar *)task->area.parent)->text_width * PANGO_SCALE);
pango_layout_set_width(layout, (((Taskbar *)task->area.parent)->text_width + 1) * PANGO_SCALE);
pango_layout_set_height(layout, panel->g_task.text_height * PANGO_SCALE);
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);