From ddb299d1d5580244608bfd38fff897df09c67e0d Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Fri, 4 Oct 2024 00:51:40 +0200 Subject: [PATCH] fix refresh --- ndisplay.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ndisplay.c b/ndisplay.c index b45053d..97a099a 100644 --- a/ndisplay.c +++ b/ndisplay.c @@ -154,8 +154,8 @@ int main (int argc, char *argv[]) int height = min (image->height - ycursor, LINES); VERBOSE (DEBUG, FILE *fd = fopen ("my.log", "a"); fprintf (fd, "(%d, %d)\n", width, height); fclose (fd)); int x, y; - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { + for (x = 0; x < width; x++) { + for (y = 0; y < height; y++) { int ind = (x + xcursor) + image->width * (y + ycursor); color_t *color = findcolor (correction (image->red[ind], gf[0]), @@ -174,10 +174,9 @@ int main (int argc, char *argv[]) add_wch (&cchar); } } - refresh (); } - refresh (); - attron (COLOR_PAIR (0)); + attron (COLOR_PAIR(0)); + redrawwin (stdscr); switch (getch ()) { case KEY_UP: -- 2.30.2