draw: fix text alignment on small width
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
35811f9c36
commit
00149a0e90
2
draw.c
2
draw.c
|
@ -406,6 +406,8 @@ draw_text(draw_context_t *ctx, font_t *font, PangoEllipsizeMode ellip, PangoWrap
|
||||||
* face */
|
* face */
|
||||||
y = area.y + (ctx->height - ext.height + 1) / 2 + pdata->margin.top;
|
y = area.y + (ctx->height - ext.height + 1) / 2 + pdata->margin.top;
|
||||||
|
|
||||||
|
/* only honors alignment if enough space */
|
||||||
|
if(ext.width < area.width)
|
||||||
switch(pdata->align)
|
switch(pdata->align)
|
||||||
{
|
{
|
||||||
case AlignCenter:
|
case AlignCenter:
|
||||||
|
|
Loading…
Reference in New Issue