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 22, 2019
1 parent 01e1544 commit 3f982e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ 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 @@ -46,8 +46,8 @@ 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 3f982e9

Please sign in to comment.