fix refresh
authorLaurent Mazet <mazet@softndesign.org>
Thu, 3 Oct 2024 22:51:40 +0000 (00:51 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Thu, 3 Oct 2024 22:51:40 +0000 (00:51 +0200)
ndisplay.c

index b45053dc018805a8b5a8f3ec60c390554002b0c7..97a099a20cf10eb5118ac51798f21ffbe9c79367 100644 (file)
@@ -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: