Skip to content

Commit

Permalink
Merge pull request #19 from olin/adam/fix_issues
Browse files Browse the repository at this point in the history
Fix cursor issues
  • Loading branch information
newsch authored Apr 13, 2019
2 parents 93dd06b + d207f74 commit bb28aae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand All @@ -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++;
Expand Down
5 changes: 5 additions & 0 deletions src/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bb28aae

Please sign in to comment.