Skip to content

Commit

Permalink
fix panning limited to terminal size
Browse files Browse the repository at this point in the history
  • Loading branch information
labseven committed Apr 16, 2019
1 parent 5fee4d3 commit 74b296e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void view_move_up(View* view) {
}

void view_move_down(View* view) {
if (view->y == view_max_y) { // Take box lines into account
if (view->y - view_max_y == view->canvas->num_rows) { // Take box lines into account
return;
}
view->y++;
Expand All @@ -37,7 +37,7 @@ void view_move_left(View* view) {
}

void view_move_right(View* view) {
if (view->x == view_max_x) { // Take box lines into account
if (view->x + view_max_x == view->canvas->num_cols) { // Take box lines into account
return;
}
view->x++;
Expand Down

0 comments on commit 74b296e

Please sign in to comment.