X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fviewer.c;h=2cf5911b2e112a5f9a1d97d2763aded3d7cdecff;hb=62a398086c517e1cc71401c9bbd69928d0ded638;hp=f0a1d99faab09f2207b8cddc3720455ca8a201dd;hpb=b76ee39c67f83aae042ba2d16e05cb0c98e8185d;p=smdp.git diff --git a/src/viewer.c b/src/viewer.c index f0a1d99..2cf5911 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -2,7 +2,7 @@ * Functions necessary to display a deck of slides in different color modes * using ncurses. Only white, red, and blue are supported, as they can be * faded in 256 color mode. - * Copyright (C) 2016 Michael Goehler + * Copyright (C) 2018 Michael Goehler * * This file is part of mdp. * @@ -158,6 +158,7 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert, int reloa max_lines_slide = sc; } + slide->lines_consumed = lc; slide = slide->next; ++sc; } @@ -337,7 +338,8 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert, int reloa // print lines while(line) { - add_line(content, l, (COLS - max_cols) / 2, line, max_cols, colors); + add_line(content, l + ((LINES - slide->lines_consumed - bar_top - bar_bottom) / 2), + (COLS - max_cols) / 2, line, max_cols, colors); // raise stop counter if we pass a line having a stop bit if(CHECK_BIT(line->bits, IS_STOP))