From: Christian Heller Date: Thu, 6 Jun 2013 10:33:13 +0000 (+0200) Subject: Ignore rightmost border column. X-Git-Tag: tce~1244 X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/index.html?a=commitdiff_plain;h=fde00b298eda3647768e977905c534ed8569ebfe;p=plomrogue Ignore rightmost border column. --- diff --git a/windows.c b/windows.c index b0a7de1..461a98e 100644 --- a/windows.c +++ b/windows.c @@ -19,7 +19,7 @@ struct WinMeta init_win_meta (WINDOW * screen) { void scroll_pad (struct WinMeta * win_meta, char dir) { // Scroll pad left or right (if possible). - if ('+' == dir && win_meta->pad_offset + win_meta->width < getmaxx(win_meta->pad)) + if ('+' == dir && win_meta->pad_offset + win_meta->width < getmaxx(win_meta->pad) - 1) win_meta->pad_offset++; else if ('-' == dir && win_meta->pad_offset > 0) win_meta->pad_offset--; } @@ -196,7 +196,7 @@ void draw_all_windows (struct WinMeta * win_meta) { if (win_meta->pad_offset > 0) for (y = 0; y < win_meta->height; y++) mvwaddch(win_meta->pad, y, win_meta->pad_offset, '<' | A_REVERSE); - if (win_meta->pad_offset + win_meta->width < getmaxx(win_meta->pad)) + if (win_meta->pad_offset + win_meta->width < getmaxx(win_meta->pad) - 1) for (y = 0; y < win_meta->height; y++) mvwaddch(win_meta->pad, y, win_meta->pad_offset + win_meta->width - 1, '>' | A_REVERSE); pnoutrefresh(win_meta->pad, 0, win_meta->pad_offset, 0, 0, win_meta->height, win_meta->width - 1); }