progressar sequence is vertical if w < h

This commit is contained in:
Martin Duquesnoy 2012-02-05 17:48:11 +01:00
parent bb2b3e02bb
commit 1aad44afc4

View File

@ -372,9 +372,17 @@ status_apply_list(struct status_ctx *ctx)
g.x = sq->geo.x + sq->data[0]; g.x = sq->geo.x + sq->data[0];
g.y = sq->geo.y + sq->data[0]; g.y = sq->geo.y + sq->data[0];
g.w = sq->geo.w - sq->data[0] - sq->data[0]; g.w = sq->geo.w - sq->data[0] - sq->data[0];
g.w /= ((float)sq->data[2] / (float)sq->data[1]);
g.h = sq->geo.h - sq->data[0] - sq->data[0]; g.h = sq->geo.h - sq->data[0] - sq->data[0];
if(sq->geo.w > sq->geo.h)
g.w /= ((float)sq->data[2] / (float)sq->data[1]);
else
{
g.y += g.h;
g.h /= ((float)sq->data[2] / (float)sq->data[1]);
g.y -= g.h;
}
draw_rect(ctx->barwin->dr, &g, sq->color2); draw_rect(ctx->barwin->dr, &g, sq->color2);
STORE_MOUSEBIND(); STORE_MOUSEBIND();