mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
ncplot: don't print spaces #695
This commit is contained in:
parent
0e1617811f
commit
827c2f2013
@ -12,6 +12,7 @@ Run unit tests (`make && make test`):
|
||||
Run, using `valgrind --tool=memcheck --leak-check=full`:
|
||||
* `notcurses-demo` in each of the three multimedia configurations
|
||||
* `notcurses-demo` with `USE_QRCODEGEN=off`
|
||||
* `notcurses-demo` in ASCII mode (`export LANG=C`)
|
||||
* `notcurses-ncreel`
|
||||
* `notcurses-input`
|
||||
* `notcurses-view` with each scaling mode and an image + video, in three
|
||||
|
@ -202,22 +202,24 @@ class ncppplot {
|
||||
// we would have errored out during construction). even then, however,
|
||||
// we need handle ASCII differently, since it can't print full block.
|
||||
// in ASCII mode, egcidx != means swap colors and use space.
|
||||
if(notcurses_canutf8(ncplane_notcurses(ncp)) || !sumidx){
|
||||
if(ncplane_putwc_yx(ncp, dimy - y - 1, x, egc[sumidx]) <= 0){
|
||||
return -1;
|
||||
if(sumidx){
|
||||
if(notcurses_canutf8(ncplane_notcurses(ncp))){
|
||||
if(ncplane_putwc_yx(ncp, dimy - y - 1, x, egc[sumidx]) <= 0){
|
||||
return -1;
|
||||
}
|
||||
}else{
|
||||
const uint64_t swapbg = channels_bchannel(channels);
|
||||
const uint64_t swapfg = channels_fchannel(channels);
|
||||
channels_set_bchannel(&channels, swapfg);
|
||||
channels_set_fchannel(&channels, swapbg);
|
||||
ncplane_set_channels(ncp, channels);
|
||||
if(ncplane_putsimple_yx(ncp, dimy - y - 1, x, ' ') <= 0){
|
||||
return -1;
|
||||
}
|
||||
channels_set_bchannel(&channels, swapbg);
|
||||
channels_set_fchannel(&channels, swapfg);
|
||||
ncplane_set_channels(ncp, channels);
|
||||
}
|
||||
}else{
|
||||
const uint64_t swapbg = channels_bchannel(channels);
|
||||
const uint64_t swapfg = channels_fchannel(channels);
|
||||
channels_set_bchannel(&channels, swapfg);
|
||||
channels_set_fchannel(&channels, swapbg);
|
||||
ncplane_set_channels(ncp, channels);
|
||||
if(ncplane_putsimple_yx(ncp, dimy - y - 1, x, ' ') <= 0){
|
||||
return -1;
|
||||
}
|
||||
channels_set_bchannel(&channels, swapbg);
|
||||
channels_set_fchannel(&channels, swapfg);
|
||||
ncplane_set_channels(ncp, channels);
|
||||
}
|
||||
if(done){
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user