From d1a01e8fe81d352e1c037cf42256ad2c4940e1c2 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 22 Apr 2021 01:18:33 -0400 Subject: [PATCH] bitmaps: never allow the last row to be used #1571 --- src/demo/intro.c | 3 +++ src/lib/visual.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/demo/intro.c b/src/demo/intro.c index f11f093b9..9e389f367 100644 --- a/src/demo/intro.c +++ b/src/demo/intro.c @@ -96,6 +96,9 @@ orcaride(struct notcurses* nc, struct ncplane* on){ if(ox >= (dimx - odimx) / 4){ ox -= (dimx - odimx) / 4; } + if(ox < 1){ + ox = 1; + } if(ncplane_move_yx(on, oy, ox)){ return -1; } diff --git a/src/lib/visual.c b/src/lib/visual.c index cadbd8d83..937238f88 100644 --- a/src/lib/visual.c +++ b/src/lib/visual.c @@ -625,9 +625,10 @@ ncplane* ncvisual_render_pixels(notcurses* nc, ncvisual* ncv, const struct blits if(scaling != NCSCALE_NONE && scaling != NCSCALE_NONE_HIRES){ notcurses_term_dim_yx(nc, &disprows, &dispcols); if(!(flags & NCVISUAL_OPTION_VERALIGNED)){ - // some terminals scroll when bitmaps hit the last line - disprows -= (placey + 1); + disprows -= placey; } + // some terminals scroll when bitmaps hit the last line + --disprows; dispcols *= nc->tcache.cellpixx; disprows *= nc->tcache.cellpixy; clamp_to_sixelmax(&nc->tcache, &disprows, &dispcols);