widget: bug fix when widget->len = 0

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-10-21 17:45:05 +02:00
parent d3ceff0282
commit f236a22b62
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ widget_render(widget_node_array_t *widgets, draw_context_t *ctx, xcb_gcontext_t
left += widgets->tab[i].widget->draw(ctx, screen, &widgets->tab[i], left, (left + right), wibox); left += widgets->tab[i].widget->draw(ctx, screen, &widgets->tab[i], left, (left + right), wibox);
/* renders right widget from last to first */ /* renders right widget from last to first */
for(int i = widgets->len - 1; i; i--) for(int i = widgets->len - 1; i >= 0; i--)
if(widgets->tab[i].widget->align == AlignRight && widgets->tab[i].widget->isvisible) if(widgets->tab[i].widget->align == AlignRight && widgets->tab[i].widget->isvisible)
right += widgets->tab[i].widget->draw(ctx, screen, &widgets->tab[i], right, (left + right), wibox); right += widgets->tab[i].widget->draw(ctx, screen, &widgets->tab[i], right, (left + right), wibox);