[visual] work for all alignment types

pull/1466/head
nick black 4 years ago committed by Nick Black
parent 42e1e4f5d0
commit 8b9af4cf0e

@ -16,6 +16,9 @@ int ncvisual_decode(ncvisual* nc){
int ncvisual_blit(ncvisual* ncv, int rows, int cols, ncplane* n, int ncvisual_blit(ncvisual* ncv, int rows, int cols, ncplane* n,
const struct blitset* bset, int leny, int lenx, const struct blitset* bset, int leny, int lenx,
const blitterargs* barg){ const blitterargs* barg){
if(barg->placex < 0 || barg->placey < 0){
return -1;
}
int ret = -1; int ret = -1;
if(visual_implementation){ if(visual_implementation){
if(visual_implementation->visual_blit(ncv, rows, cols, n, bset, if(visual_implementation->visual_blit(ncv, rows, cols, n, bset,
@ -472,8 +475,7 @@ ncplane* ncvisual_render_cells(notcurses* nc, ncvisual* ncv, const struct blitse
} // else stretch } // else stretch
} }
if(flags & NCVISUAL_OPTION_HORALIGNED){ if(flags & NCVISUAL_OPTION_HORALIGNED){
// FIXME this only centers placex = ncplane_align(n, placex, dispcols / encoding_x_scale(&nc->tcache, bset));
placex = (ncplane_dim_x(n) - dispcols / encoding_x_scale(&nc->tcache, bset)) / 2;
} }
} }
leny = (leny / (double)ncv->rows) * ((double)disprows); leny = (leny / (double)ncv->rows) * ((double)disprows);

Loading…
Cancel
Save