run the logend{yx} state machine in raster #1906

This commit is contained in:
nick black 2021-07-09 04:27:38 -04:00 committed by nick black
parent f9c8102e37
commit 0c484e4e02

View File

@ -748,6 +748,12 @@ goto_location(notcurses* nc, FILE* out, int y, int x){
} }
nc->rstate.x = x; nc->rstate.x = x;
nc->rstate.y = y; nc->rstate.y = y;
if(nc->rstate.logendy >= 0){
if(y > nc->rstate.logendy || (y == nc->rstate.logendy && x > nc->rstate.logendx)){
nc->rstate.logendy = y;
nc->rstate.logendx = x;
}
}
return ret; return ret;
} }
@ -905,6 +911,13 @@ clean_sprixels(notcurses* nc, ncpile* p, FILE* out){
static int static int
rasterize_scrolls(ncpile* p, FILE* out){ rasterize_scrolls(ncpile* p, FILE* out){
//fprintf(stderr, "%d tardies to work off, by far the most in the class\n", p->scrolls); //fprintf(stderr, "%d tardies to work off, by far the most in the class\n", p->scrolls);
if(p->nc->rstate.logendy >= 0){
p->nc->rstate.logendy -= p->scrolls;
if(p->nc->rstate.logendy < 0){
p->nc->rstate.logendy = 0;
p->nc->rstate.logendx = 0;
}
}
while(p->scrolls){ while(p->scrolls){
if(ncfputc('\v', out) < 0){ if(ncfputc('\v', out) < 0){
return -1; return -1;