Mercurial > hg > svgui
diff layer/LinearColourScale.cpp @ 944:78c152e4db95
Merge from branch tonioni
author | Chris Cannam |
---|---|
date | Mon, 20 Apr 2015 09:12:17 +0100 |
parents | b66fb15de477 |
children | 4fe7a09be0fe |
line wrap: on
line diff
--- a/layer/LinearColourScale.cpp Thu Jan 15 10:42:00 2015 +0000 +++ b/layer/LinearColourScale.cpp Mon Apr 20 09:12:17 2015 +0100 @@ -34,15 +34,15 @@ const ColourScaleLayer *layer, QPainter &paint, int /* x0 */, - float min, - float max) + double min, + double max) { int h = v->height(); int n = 10; - float val = min; - float inc = (max - val) / n; + double val = min; + double inc = (max - val) / n; const int buflen = 40; char buffer[buflen]; @@ -58,16 +58,16 @@ paint.save(); for (int y = 0; y < boxh; ++y) { - float val = ((boxh - y) * (max - min)) / boxh + min; + double val = ((boxh - y) * (max - min)) / boxh + min; paint.setPen(layer->getColourForValue(v, val)); paint.drawLine(boxx + 1, y + boxy + 1, boxx + boxw, y + boxy + 1); } paint.restore(); -// float round = 1.f; +// double round = 1.f; int dp = 0; if (inc > 0) { - int prec = trunc(log10f(inc)); + int prec = int(trunc(log10(inc))); prec -= 1; if (prec < 0) dp = -prec; // round = powf(10.f, prec);