From 25fee034cb4b18bda116e6b3b2d88af2f5923314 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 16 May 2020 20:33:06 -0400 Subject: [PATCH] ncplot: print EGC before breaking on small glyph #605 --- src/lib/plot.cpp | 2 +- src/lib/{cpp.h => plot.h} | 12 ++++++------ tests/plot.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) rename src/lib/{cpp.h => plot.h} (99%) diff --git a/src/lib/plot.cpp b/src/lib/plot.cpp index 3cc9a3310..1e0556cdc 100644 --- a/src/lib/plot.cpp +++ b/src/lib/plot.cpp @@ -1,4 +1,4 @@ -#include "cpp.h" +#include "plot.h" using ncuplot = struct ncuplot { ncppplot n; diff --git a/src/lib/cpp.h b/src/lib/plot.h similarity index 99% rename from src/lib/cpp.h rename to src/lib/plot.h index 35275d20c..bdce7e7e6 100644 --- a/src/lib/cpp.h +++ b/src/lib/plot.h @@ -1,6 +1,6 @@ -#include "notcurses/notcurses.h" #include #include +#include "notcurses/notcurses.h" static const struct { ncgridgeom_e geom; @@ -200,22 +200,22 @@ class ncppplot { }else{ egcidx = (gvals[i] - intervalbase) / interval; } -//fprintf(stderr, "egcidx: %zu\n", egcidx); +//fprintf(stderr, "%d/%d ibase: %f egcidx: %zu\n", dimy - y - 1, x, intervalbase, egcidx); if(egcidx >= states){ egcidx = states - 1; + done = false; } - done = false; sumidx += egcidx; }else{ egcidx = 0; } } - if(done){ - break; - } if(ncplane_putwc_yx(ncp, dimy - y - 1, x, egc[sumidx]) <= 0){ return -1; } + if(done){ + break; + } if(exponentiali){ intervalbase = miny + pow(interval, y * states); }else{ diff --git a/tests/plot.cpp b/tests/plot.cpp index c6ceb16c2..fdfda5db5 100644 --- a/tests/plot.cpp +++ b/tests/plot.cpp @@ -1,5 +1,5 @@ #include "main.h" -#include "cpp.h" +#include "plot.h" #include #include