From 15bd5cfd56a1a855e124dc3cd2e0bd8b92f7e179 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 1 Jun 2020 22:34:12 -0400 Subject: [PATCH] notcurses-view: properly handle resize Since notcurses-view is now rendering to the standard plane, and ncvisual is no longer bound to a plane, there's no need to call ncplane_resize() (and doing so fails, since you can't resize the standard plane). Remove the call, leave the check. Fixes resizing. --- src/view/view.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/view/view.cpp b/src/view/view.cpp index c42544550..f1ff00ba4 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -92,11 +92,9 @@ auto perframe(struct ncplane* n, struct ncvisual* ncv, if(!nc.render()){ return -1; } - int dimx, dimy, oldx, oldy, keepy, keepx; + int dimx, dimy, oldx, oldy; nc.get_term_dim(&dimy, &dimx); ncplane_dim_yx(n, &oldy, &oldx); - keepy = oldy > dimy ? dimy : oldy; - keepx = oldx > dimx ? dimx : oldx; struct timespec interval; clock_gettime(CLOCK_MONOTONIC, &interval); uint64_t nsnow = timespec_to_ns(&interval); @@ -106,7 +104,7 @@ auto perframe(struct ncplane* n, struct ncvisual* ncv, char32_t keyp; while((keyp = nc.getc(&interval, nullptr, nullptr)) != (char32_t)-1){ if(keyp == NCKEY_RESIZE){ - return ncplane_resize(n, 0, 0, keepy, keepx, 0, 0, dimy, dimx); + return 0; } return 1; }