diff --git a/src/lib/direct.c b/src/lib/direct.c index 8c2934772..7b2236f08 100644 --- a/src/lib/direct.c +++ b/src/lib/direct.c @@ -489,9 +489,9 @@ static ncdirectv* ncdirect_render_visual(ncdirect* n, ncvisual* ncv, ncblitter_e blitfxn, ncscale_e scale, int ymax, int xmax, uint32_t transcolor){ - int dimy = ymax > 0 ? ymax : ncdirect_dim_y(n); + int dimy = ymax > 0 ? ymax : (ncdirect_dim_y(n) - 1); int dimx = xmax > 0 ? xmax : ncdirect_dim_x(n); -//fprintf(stderr, "OUR DATA: %p rows/cols: %d/%d\n", ncv->data, ncv->pixy, ncv->pixx); +//fprintf(stderr, "OUR DATA: %p rows/cols: %d/%d outsize: %d/%d\n", ncv->data, ncv->pixy, ncv->pixx, dimy, dimx); //fprintf(stderr, "render %d/%d to scaling: %d\n", ncv->pixy, ncv->pixx, scale); const struct blitset* bset = rgba_blitter_low(&n->tcache, scale, true, blitfxn); if(!bset){ @@ -505,7 +505,7 @@ ncdirect_render_visual(ncdirect* n, ncvisual* ncv, ncblitter_e blitfxn, outy = disprows; }else{ dispcols = dimx * n->tcache.cellpixx; - disprows = (dimy - 1) * n->tcache.cellpixy; + disprows = dimy * n->tcache.cellpixy; clamp_to_sixelmax(&n->tcache, &disprows, &dispcols, &outy); } if(scale == NCSCALE_SCALE || scale == NCSCALE_SCALE_HIRES){ diff --git a/src/media/oiio.h b/src/media/oiio.h index 98d2c1183..2f5126b41 100644 --- a/src/media/oiio.h +++ b/src/media/oiio.h @@ -13,7 +13,7 @@ void oiio_printbanner(const struct notcurses* nc); void oiio_details_seed(struct ncvisual* ncv); int oiio_blit(ncvisual* ncv, int rows, int cols, struct ncplane* n, const struct blitset* bset, - int leny, int lenx, const blitterargs* bargs); + const blitterargs* bargs); ncvisual* oiio_from_file(const char* filename); int oiio_decode_loop(ncvisual* ncv); int oiio_resize(ncvisual* nc, int rows, int cols); @@ -21,7 +21,7 @@ ncvisual* oiio_create(void); void oiio_destroy(ncvisual* ncv); int oiio_blit_dispatch(struct ncplane* nc, const struct blitset* bset, int linesize, const void* data, - const blitterargs* bargs); + int leny, int lenx, const blitterargs* bargs); #ifdef __cplusplus }