From 8444011d70582b04b53a5b77beb9cb1144bffd15 Mon Sep 17 00:00:00 2001 From: Evan New-Schmidt Date: Wed, 22 May 2019 17:19:22 -0400 Subject: [PATCH] Redraw if view is snapped --- src/fe_modes.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fe_modes.c b/src/fe_modes.c index 45b6390..4950c2c 100644 --- a/src/fe_modes.c +++ b/src/fe_modes.c @@ -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(); } }