mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
allglyph: only render at end of line
This commit is contained in:
parent
c55e4bb7bf
commit
8c8d862d23
@ -12,21 +12,21 @@
|
|||||||
// works on a scrolling plane
|
// works on a scrolling plane
|
||||||
static int
|
static int
|
||||||
allglyphs(struct notcurses* nc, struct ncplane* column){
|
allglyphs(struct notcurses* nc, struct ncplane* column){
|
||||||
const int PERIOD = 8;
|
|
||||||
const int valid_planes[] = {
|
const int valid_planes[] = {
|
||||||
0, 1, 2, 3, 14, 15, 16, -1
|
0, 1, 2, 3, 14, 15, 16, -1
|
||||||
};
|
};
|
||||||
int period = 0;
|
const int dimx = ncplane_dim_x(column);
|
||||||
for(const int* plane = valid_planes ; *plane >= 0 ; ++plane){
|
for(const int* plane = valid_planes ; *plane >= 0 ; ++plane){
|
||||||
for(long int c = 0 ; c < 0x10000l ; ++c){
|
for(long int c = 0 ; c < 0x10000l ; ++c){
|
||||||
wchar_t w[2] = { *plane * 0x10000l + c, L'\0' };
|
wchar_t w[2] = { *plane * 0x10000l + c, L'\0', };
|
||||||
if(wcswidth(w, UINT_MAX) >= 1){
|
if(wcwidth(w[0]) >= 1){
|
||||||
|
int x;
|
||||||
if(ncplane_putwegc(column, w, NULL) < 0){
|
if(ncplane_putwegc(column, w, NULL) < 0){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(++period % PERIOD == 0){
|
ncplane_cursor_yx(column, NULL, &x);
|
||||||
|
if(x >= dimx){
|
||||||
DEMO_RENDER(nc);
|
DEMO_RENDER(nc);
|
||||||
period = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user