ncvisual_render: handle NCSCALE_NONE_HIRES #1250

pull/1259/head
nick black 4 years ago committed by Nick Black
parent 56d94e9392
commit 91e932ed26

@ -42,7 +42,7 @@ zoom_map(struct notcurses* nc, const char* map, int* ret){
// but *do* explicitly supply NCBLIT_2x2 since we're not scaling.
struct ncvisual_options vopts = {
.y = 1,
.blitter = ncvisual_media_defblitter(nc, NCSCALE_NONE_HIRES),
.blitter = NCBLIT_2x2,
};
if(ncvisual_geom(nc, ncv, &vopts, &vheight, &vwidth, &yscale, &xscale)){
ncvisual_destroy(ncv);
@ -52,8 +52,8 @@ zoom_map(struct notcurses* nc, const char* map, int* ret){
// we start at the lower left corner of the outzoomed map
int placey, placex; // dimensions of true display
notcurses_term_dim_yx(nc, &placey, &placex);
float delty = 3;
float deltx = 3;
float delty = 2 + yscale;
float deltx = 2 + xscale;
float truey = placey;
float truex = placex;
if(truey > truex){

@ -51,10 +51,10 @@ pbar_make(struct notcurses* nc, int row){
return NULL;
}
struct ncprogbar_options popts = {0};
channel_set_rgb8(&popts.ulchannel, 0x80, 0x22, 0x80);
channel_set_rgb8(&popts.urchannel, 0x80, 0x22, 0x80);
channel_set_rgb8(&popts.blchannel, 0x80, 0x22, 0x22);
channel_set_rgb8(&popts.brchannel, 0x80, 0x22, 0x22);
channel_set_rgb8(&popts.ulchannel, 0x22, 0x22, 0x80);
channel_set_rgb8(&popts.urchannel, 0x22, 0x22, 0x80);
channel_set_rgb8(&popts.blchannel, 0x80, 0x80, 0x22);
channel_set_rgb8(&popts.brchannel, 0x80, 0x80, 0x22);
struct ncprogbar* ncp = ncprogbar_create(pbar, &popts);
if(ncp == NULL){
return NULL;

@ -34,7 +34,7 @@ auto ncvisual_geom(const notcurses* nc, const ncvisual* n,
}
if(n){
if(scale == NCSCALE_NONE || scale == NCSCALE_NONE_HIRES){
*y = n->rows * encoding_y_scale(bset);
*y = n->rows;
*x = n->cols * encoding_x_scale(bset);
}else{
int rows = vopts->n ? ncplane_dim_y(vopts->n) : ncplane_dim_y(nc->stdplane);
@ -406,9 +406,9 @@ auto ncvisual_render(notcurses* nc, ncvisual* ncv,
ncplane* n = nullptr;
//fprintf(stderr, "INPUT N: %p\n", vopts ? vopts->n : nullptr);
if((n = (vopts ? vopts->n : nullptr)) == nullptr){ // create plane
if(!vopts || vopts->scaling == NCSCALE_NONE){
dispcols = ncv->cols;
disprows = ncv->rows;
if(!vopts || vopts->scaling == NCSCALE_NONE || vopts->scaling == NCSCALE_NONE_HIRES){
dispcols = ncv->cols * encoding_x_scale(bset);
disprows = ncv->rows * encoding_y_scale(bset);
}else{
notcurses_term_dim_yx(nc, &disprows, &dispcols);
dispcols *= encoding_x_scale(bset);

Loading…
Cancel
Save