Should fix coverity issue 191811 - and a little extra
This commit is contained in:
@@ -820,14 +820,14 @@ void HistogramArea::updateBackBuffer ()
|
|||||||
// draw vertical gridlines
|
// draw vertical gridlines
|
||||||
if (options.histogramDrawMode < 2) {
|
if (options.histogramDrawMode < 2) {
|
||||||
for (int i = 1; i < nrOfVGridPartitions; i++) {
|
for (int i = 1; i < nrOfVGridPartitions; i++) {
|
||||||
cr->move_to ((pow(2.0,i) - 1) / 255 * w + 0.5, 1.5);
|
cr->move_to ((pow(2.0,i) - 1) / 255.0 * w + 0.5, 1.5);
|
||||||
cr->line_to ((pow(2.0,i) - 1) / 255 * w + 0.5, h - 2);
|
cr->line_to ((pow(2.0,i) - 1) / 255.0 * w + 0.5, h - 2);
|
||||||
cr->stroke ();
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 1; i < nrOfVGridPartitions; i++) {
|
for (int i = 1; i < nrOfVGridPartitions; i++) {
|
||||||
cr->move_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255 * w + 0.5, 1.5);
|
cr->move_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255.0 * w + 0.5, 1.5);
|
||||||
cr->line_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255 * w + 0.5, h - 2);
|
cr->line_to (HistogramScaling::log (255, pow(2.0,i) - 1) / 255.0 * w + 0.5, h - 2);
|
||||||
cr->stroke ();
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -835,14 +835,14 @@ void HistogramArea::updateBackBuffer ()
|
|||||||
// draw horizontal gridlines
|
// draw horizontal gridlines
|
||||||
if (options.histogramDrawMode == 0) {
|
if (options.histogramDrawMode == 0) {
|
||||||
for (int i = 1; i < nrOfHGridPartitions; i++) {
|
for (int i = 1; i < nrOfHGridPartitions; i++) {
|
||||||
cr->move_to (1.5, i * h / nrOfHGridPartitions + 0.5);
|
cr->move_to (1.5, i * (double)h / nrOfHGridPartitions + 0.5);
|
||||||
cr->line_to (w - 2, i * h / nrOfHGridPartitions + 0.5);
|
cr->line_to (w - 2, i * (double)h / nrOfHGridPartitions + 0.5);
|
||||||
cr->stroke ();
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 1; i < nrOfHGridPartitions; i++) {
|
for (int i = 1; i < nrOfHGridPartitions; i++) {
|
||||||
cr->move_to (1.5, h - HistogramScaling::log (h, i * h / nrOfHGridPartitions) + 0.5);
|
cr->move_to (1.5, h - HistogramScaling::log (h, i * (double)h / nrOfHGridPartitions) + 0.5);
|
||||||
cr->line_to (w - 2, h - HistogramScaling::log (h, i * h / nrOfHGridPartitions) + 0.5);
|
cr->line_to (w - 2, h - HistogramScaling::log (h, i * (double)h / nrOfHGridPartitions) + 0.5);
|
||||||
cr->stroke ();
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user