plot: use at least maxchannel #136

This commit is contained in:
nick black 2020-04-03 07:57:02 -04:00 committed by Nick Black
parent 68b4ba1706
commit 8f65958a53
2 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,9 @@ int main(void){
popts.detectdomain = true;
std::array<struct ncplot*, 5> plots;
for(auto i = 0u ; i < plots.size() ; ++i){
popts.maxchannel = 0;
channels_set_fg_rgb(&popts.maxchannel, random() % 256, random() % 256, random() % 256);
channels_set_fg_rgb(&popts.minchannel, random() % 256, random() % 256, random() % 256);
popts.gridtype = static_cast<ncgridgeom_e>(i);
plots[i] = ncplot_create(planes[i], &popts);
}

View File

@ -145,6 +145,7 @@ redraw_plot(ncplot* n){
if(gval > n->maxy){
gval = n->maxy;
}
ncplane_set_fg(ncplot_plane(n), channels_fg(n->maxchannel)); // FIXME lerp!
// starting from the least-significant row, progress in the more significant
// direction, drawing egcs from the grid specification, aborting early if
// we can't draw anything in a given cell.