From: Michael Göhler Date: Mon, 1 Sep 2014 21:51:22 +0000 (+0200) Subject: handle fading on undefined key press correctly X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=66f6ce722f0d763efbf66ca6f8a958bc75ab854e;p=smdp.git handle fading on undefined key press correctly --- diff --git a/viewer.c b/viewer.c index 6dac23b..a6cf53c 100644 --- a/viewer.c +++ b/viewer.c @@ -172,6 +172,9 @@ int ncurses_display(deck_t *deck, int notrans, int nofade) { if(fade) fade_in(content, trans, colors); + // re-enable fading after any undefined key press + if(COLORS == 256 && !nofade) fade = 1; + // wait for user input c = getch(); @@ -207,6 +210,11 @@ int ncurses_display(deck_t *deck, int notrans, int nofade) { fade = 0; slide = (void*)0; break; + + default: + // disable fading on undefined key press + fade = 0; + break; } // fade out