This commit is contained in:
Your Name 2024-04-02 19:41:23 +03:00
parent 71bcd4d370
commit e887e4f4da

View File

@ -60,12 +60,12 @@ void sig_handler(int sig) {
exit(0); exit(0);
} }
void print(int y, int x, char *str, int val) { void print(int y, int x, char *str, int val, int j) {
if (val < 0) if (val < 0)
mvprintw(y, x, "%s", str); mvprintw(y + j, x, "%s", str);
else else
mvprintw(y, x, "%s", str); mvprintw(y - j, x, "%s", str);
} }
int main(void) { int main(void) {
@ -100,13 +100,8 @@ int main(void) {
max = val; max = val;
int lvl = (val - min) * (ws.ws_row / 5) / ((max - min) + 1); int lvl = (val - min) * (ws.ws_row / 5) / ((max - min) + 1);
for (int j = 0; j < lvl; j++) { for (int j = 0; j < lvl; j++)
print(middle - j, i, "$", values[i]); print(middle, i, "$", values[i], j);
print(middle + j, i, "$", values[i]);
}
print(middle - lvl, i, ".", values[i]);
print(middle + lvl, i, "'", values[i]);
} }
refresh(); refresh();