From ea106fef3ee03f058c83ecfbbf619ac36465771c Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sun, 20 Jul 2014 22:55:28 -0400 Subject: [PATCH] Fix size issues --- source/screen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/screen.c b/source/screen.c index 9061c3e..0f02328 100644 --- a/source/screen.c +++ b/source/screen.c @@ -58,16 +58,19 @@ static void screen_place_windows(void) { wrefresh(p_frame->p_win); /* Print any other frames we might have */ + int pos = 0; for(i = 0; i < vec_size(Screen_List); i++) { - int height = (lines / vec_size(Screen_List)); + int remain = (lines % vec_size(Screen_List)); + int height = (lines / vec_size(Screen_List)) + (i < remain ? 1 : 0); p_frame = (frame_t*)vec_at(Screen_List, i); - mvwin(p_frame->p_win, i*height, cols/2); + mvwin(p_frame->p_win, pos, cols/2); wresize(p_frame->p_win, height, cols/2); wclear(p_frame->p_win); wmove(p_frame->p_win, 1, 1); wprintw(p_frame->p_win, "(%d, %d)", i*height, cols/2); box(p_frame->p_win, 0 , 0); wrefresh(p_frame->p_win); + pos += height; } } -- 2.49.0