mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
postpaint_cell()/ncplane_putc(): handle EGCs of more than 2 columns #1273
This commit is contained in:
parent
8285b131c6
commit
9dcbda54ef
@ -1593,16 +1593,18 @@ ncplane_put(ncplane* n, int y, int x, const char* egc, int cols,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//fprintf(stderr, "%08x %016lx %c %d %d\n", targ->gcluster, targ->channels, cell_double_wide_p(targ) ? 'D' : 'd', bytes, cols);
|
//fprintf(stderr, "%08x %016lx %c %d %d\n", targ->gcluster, targ->channels, cell_double_wide_p(targ) ? 'D' : 'd', bytes, cols);
|
||||||
if(cols > 1){ // must set our right wide, and check for further damage
|
// must set our right hand sides wide, and check for further damage
|
||||||
nccell* candidate = &n->fb[nfbcellidx(n, n->y, n->x + 1)];
|
++n->x;
|
||||||
|
for(int i = 1 ; i < cols ; ++i){
|
||||||
|
nccell* candidate = &n->fb[nfbcellidx(n, n->y, n->x)];
|
||||||
if(cell_wide_left_p(candidate)){
|
if(cell_wide_left_p(candidate)){
|
||||||
cell_obliterate(n, &n->fb[nfbcellidx(n, n->y, n->x + 2)]);
|
cell_obliterate(n, &n->fb[nfbcellidx(n, n->y, n->x + 1)]);
|
||||||
}
|
}
|
||||||
cell_release(n, candidate);
|
cell_release(n, candidate);
|
||||||
candidate->channels = targ->channels;
|
candidate->channels = targ->channels;
|
||||||
candidate->stylemask = targ->stylemask;
|
candidate->stylemask = targ->stylemask;
|
||||||
|
++n->x;
|
||||||
}
|
}
|
||||||
n->x += cols;
|
|
||||||
return cols;
|
return cols;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +402,10 @@ postpaint_cell(nccell* lastframe, int dimx, struct crender* crender,
|
|||||||
nccell* prevcell = &lastframe[fbcellidx(y, dimx, x)];
|
nccell* prevcell = &lastframe[fbcellidx(y, dimx, x)];
|
||||||
if(cellcmp_and_dupfar(pool, prevcell, crender->p, targc) > 0){
|
if(cellcmp_and_dupfar(pool, prevcell, crender->p, targc) > 0){
|
||||||
crender->damaged = true;
|
crender->damaged = true;
|
||||||
|
assert(!cell_wide_right_p(targc));
|
||||||
if(cell_wide_left_p(targc)){
|
if(cell_wide_left_p(targc)){
|
||||||
|
const int width = targc->width;
|
||||||
|
for(int i = 1 ; i < width ; ++i){
|
||||||
const ncplane* tmpp = crender->p;
|
const ncplane* tmpp = crender->p;
|
||||||
++crender;
|
++crender;
|
||||||
crender->p = tmpp;
|
crender->p = tmpp;
|
||||||
@ -417,6 +420,7 @@ postpaint_cell(nccell* lastframe, int dimx, struct crender* crender,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user