mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
textplayer: dewhiten last character written on delay #1649
This commit is contained in:
parent
e7d40e00e3
commit
3a6a2fa90b
@ -23,11 +23,17 @@ init(void){
|
|||||||
return nc;
|
return nc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// normally called with hicolor of HICOLOR, but sometimes we need to dull
|
||||||
|
// it out (when we pause, and at the end)
|
||||||
static int
|
static int
|
||||||
colorize(struct ncplane* n){
|
colorize(struct ncplane* n, uint32_t hicolor){
|
||||||
int y, x;
|
int y, x;
|
||||||
ncplane_cursor_yx(n, &y, &x);
|
// FIXME it seems we ought be able to use ncplane_cursor_yx() here, but in
|
||||||
uint32_t c = HICOLOR;
|
// the presence of scrolling, it seems to give wonky results. see #1649.
|
||||||
|
//ncplane_cursor_yx(n, &y, &x);
|
||||||
|
y = ncplane_dim_y(n) - 1;
|
||||||
|
x = ncplane_dim_x(n) - 1;
|
||||||
|
uint32_t c = hicolor;
|
||||||
ncplane_set_bg_rgb(n, 0x222222);
|
ncplane_set_bg_rgb(n, 0x222222);
|
||||||
while(y >= 0){
|
while(y >= 0){
|
||||||
while(x >= 0){
|
while(x >= 0){
|
||||||
@ -128,7 +134,7 @@ textplay(struct notcurses* nc, struct ncplane* tplane, struct ncvisual* ncv){
|
|||||||
if(pt < 0){
|
if(pt < 0){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if(colorize(tplane)){
|
if(colorize(tplane, HICOLOR)){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if(notcurses_render(nc)){
|
if(notcurses_render(nc)){
|
||||||
@ -145,11 +151,25 @@ textplay(struct notcurses* nc, struct ncplane* tplane, struct ncvisual* ncv){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(wc == L'…'){
|
if(wc == L'…'){
|
||||||
|
// first, dull out the leading character
|
||||||
|
if(colorize(tplane, 0x00ff80)){
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if(notcurses_render(nc)){
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
if(longdelay(nc, ncv, &vopts)){
|
if(longdelay(nc, ncv, &vopts)){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// dull out the leading character for exit
|
||||||
|
if(colorize(tplane, 0x00ff80)){
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if(notcurses_render(nc)){
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
ncplane_destroy(vopts.n);
|
ncplane_destroy(vopts.n);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user