Quellcode durchsuchen

progressar sequence is vertical if w < h

Martin Duquesnoy vor 12 Jahren
Ursprung
Commit
1aad44afc4
1 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  1. 9 1
      src/status.c

+ 9 - 1
src/status.c

@@ -372,9 +372,17 @@ status_apply_list(struct status_ctx *ctx)
                g.x = sq->geo.x + sq->data[0];
                g.y = sq->geo.y + 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];
 
+               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);
 
                STORE_MOUSEBIND();