# HG changeset patch # User Chris Cannam # Date 1479897572 0 # Node ID 958e352919a587f0e9702b0d43f5667b8167e71c # Parent b5c88c448ca2bf7e5070177c7561ba15a929bd88 Avoid rounding error giving too few bins in column request diff -r b5c88c448ca2 -r 958e352919a5 layer/Colour3DPlotRenderer.cpp --- a/layer/Colour3DPlotRenderer.cpp Mon Nov 21 15:33:08 2016 +0000 +++ b/layer/Colour3DPlotRenderer.cpp Wed Nov 23 10:39:32 2016 +0000 @@ -31,7 +31,7 @@ #include -#define DEBUG_COLOUR_PLOT_REPAINT 1 +//#define DEBUG_COLOUR_PLOT_REPAINT 1 using namespace std; @@ -813,12 +813,12 @@ if (minbin >= sh) minbin = sh - 1; if (minbin < 0) minbin = 0; - int nbins = int(binfory[h-1]) - minbin + 1; + int nbins = int(binfory[h-1] + 0.0001) - minbin + 1; if (minbin + nbins > sh) nbins = sh - minbin; #ifdef DEBUG_COLOUR_PLOT_REPAINT cerr << "minbin = " << minbin << ", nbins = " << nbins << ", last binfory = " - << binfory[h-1] << " (model height " << sh << ")" << endl; + << binfory[h-1] << " (rounds to " << int(binfory[h-1]) << ") (model height " << sh << ")" << endl; #endif int psx = -1;