direct: bounce, bounce, bounce somewhere else #1560

This commit is contained in:
nick black 2021-05-02 18:59:34 -04:00 committed by Nick Black
parent f19368c61f
commit c02467bb84
2 changed files with 5 additions and 5 deletions

View File

@ -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){

View File

@ -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
}