From 8f65958a53858d1cf602e6717045ec8524d23ba9 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 3 Apr 2020 07:57:02 -0400 Subject: [PATCH] plot: use at least maxchannel #136 --- src/input/keyplot.cpp | 3 +++ src/lib/plot.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/input/keyplot.cpp b/src/input/keyplot.cpp index 48eabc8bf..3fc1c4415 100644 --- a/src/input/keyplot.cpp +++ b/src/input/keyplot.cpp @@ -36,6 +36,9 @@ int main(void){ popts.detectdomain = true; std::array 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(i); plots[i] = ncplot_create(planes[i], &popts); } diff --git a/src/lib/plot.c b/src/lib/plot.c index b211f40e6..01ed571d8 100644 --- a/src/lib/plot.c +++ b/src/lib/plot.c @@ -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.