From 1cc597698a047b5ea8c9d4757e660ff49b630cd4 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 1 Nov 2021 14:49:00 -0400 Subject: [PATCH] [cblit] x/y mixup in geom calculations --- src/lib/visual.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/visual.c b/src/lib/visual.c index fd5ed05a5..a1bbad899 100644 --- a/src/lib/visual.c +++ b/src/lib/visual.c @@ -403,6 +403,10 @@ int ncvisual_geom_inner(const tinfo* ti, const ncvisual* n, geom->rcellx = *outx / ti->cellpixx + !!(*outx % ti->cellpixx); geom->rcelly = *outy / ti->cellpixy + !!(*outy % ti->cellpixy); }else{ // cellblit + if(vopts->pxoffx || vopts->pxoffy){ + logerror("pixel offsets cannot be used with cell blitting\n"); + return -1; + } int dispcols, disprows; if(vopts->n == NULL || (vopts->flags & NCVISUAL_OPTION_CHILDPLANE)){ // create plane if(scaling == NCSCALE_NONE || scaling == NCSCALE_NONE_HIRES){ @@ -422,10 +426,6 @@ int ncvisual_geom_inner(const tinfo* ti, const ncvisual* n, } // else stretch } }else{ - if(vopts->pxoffx || vopts->pxoffy){ - logerror("pixel offsets cannot be used with cell blitting\n"); - return -1; - } if(scaling == NCSCALE_NONE || scaling == NCSCALE_NONE_HIRES){ dispcols = geom->lenx; disprows = geom->leny; @@ -450,8 +450,8 @@ int ncvisual_geom_inner(const tinfo* ti, const ncvisual* n, *placey = ncplane_valign(vopts->n, *placey, disprows / geom->scaley); } } - geom->rcelly = dispcols; - geom->rcellx = disprows; + geom->rcelly = disprows; + geom->rcellx = dispcols; geom->rpixy = geom->leny; geom->rpixx = geom->lenx; }