From b9d774f746f40540ad8c60bd991e655f41f24cba Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 6 Oct 2021 21:50:38 -0400 Subject: [PATCH] [intro] avoid dividing by zero without cell-pixel geometry --- src/demo/intro.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/demo/intro.c b/src/demo/intro.c index ca0659d4d..6e88cea86 100644 --- a/src/demo/intro.c +++ b/src/demo/intro.c @@ -83,6 +83,12 @@ orcashow(struct notcurses* nc, int dimy, int dimx){ &cellpxy, &cellpxx, NULL, NULL); int odimy, odimx, scaley, scalex; ncvisual_blitter_geom(nc, ncv, &vopts, &odimy, &odimx, &scaley, &scalex, NULL); + // even if we can't do pixel output, we want her the same size as if weu + // *could* do pixel output. if we have no idea as to the geom, use scale. + if(cellpxy == 0){ + cellpxy = scaley; + cellpxx = scalex; + } struct ncplane_options nopts = { .rows = (odimy / cellpxy) + !!(odimy % cellpxy), .cols = (odimx / cellpxx) + !!(odimx % cellpxx),