From 8f0885f1df6e71ac25711b958d46c175069e8faf Mon Sep 17 00:00:00 2001 From: Adam Novotny Date: Fri, 12 Apr 2019 20:51:24 -0400 Subject: [PATCH 1/2] Fix cursor entering right and bottom border --- src/cursor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cursor.c b/src/cursor.c index 940fde7..024db43 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -21,7 +21,7 @@ void cursor_move_up(Cursor* cursor) { } void cursor_move_down(Cursor* cursor) { - if (cursor->y == (LINES - 2)) { // Take box lines into account + if (cursor->y == (LINES - 5)) { // Take box lines into account return; } cursor->y++; @@ -35,7 +35,7 @@ void cursor_move_left(Cursor* cursor) { } void cursor_move_right(Cursor* cursor) { - if (cursor->x == (COLS - 2)) { // Take box lines into account + if (cursor->x == (COLS - 3)) { // Take box lines into account return; } cursor->x++; From d207f74f69ed9ee0249d0c243e1cc2108f204b8b Mon Sep 17 00:00:00 2001 From: Adam Novotny Date: Fri, 12 Apr 2019 20:53:11 -0400 Subject: [PATCH 2/2] Fix cursor starts in status window on start #7 --- src/frontend.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frontend.c b/src/frontend.c index 95142f3..998a414 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -49,7 +49,12 @@ int main(int argc, char *argv[]) { char test_msg[] = "Test mode"; print_status(test_msg, status_win); + + // Move cursor to starting location and redraw + wmove(canvas_win, cursor_y_to_canvas(cursor), cursor_x_to_canvas(cursor)); wrefresh(status_win); + wrefresh(canvas_win); // Refresh Canvas last so it gets the cursor + //// Main loop int last_arrow_direction = KEY_RIGHT;