Skip to content

Commit

Permalink
Redraw if view is snapped
Browse files Browse the repository at this point in the history
  • Loading branch information
newsch committed May 29, 2019
1 parent 70a4742 commit 8444011
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fe_modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,19 @@ int master_handler(State *state, WINDOW *canvas_win, WINDOW *status_win) {
logd("Snapped view to max height\n");
}
Cursor *c = state->cursor;
bool redraw_flag = false;
if (c->x + v->x > max_x) {
c->x = max_x - v->x;
logd("Snapped cursor to max x\n");
redraw_flag = true;
}
if (c->y + v->y > max_y) {
c->y = max_y - v->y;
logd("Snapped cursor to max y\n");
redraw_flag = true;
}
if (redraw_flag) {
redraw_canvas_win();
}
}

Expand Down

0 comments on commit 8444011

Please sign in to comment.