More double promote fixes

This commit is contained in:
Ingo Weyrich
2020-02-10 20:06:43 +01:00
parent f0b5ca02e7
commit b4c0bb3acb
8 changed files with 65 additions and 107 deletions

View File

@@ -233,21 +233,21 @@ void MyFlatCurve::draw ()
if (n > 1) {
if (pipetteR > -1.f) {
cr->set_source_rgba (1., 0., 0., 0.5); // WARNING: assuming that red values are stored in pipetteR, which might not be the case!
cr->move_to (graphX + graphW*pipetteR, graphY + 1. * s);
cr->move_to (graphX + graphW * static_cast<double>(pipetteR), graphY + 1. * s);
cr->rel_line_to (0, -graphH - 1. * s);
cr->stroke ();
}
if (pipetteG > -1.f) {
cr->set_source_rgba (0., 1., 0., 0.5); // WARNING: assuming that green values are stored in pipetteG, which might not be the case!
cr->move_to (graphX + graphW*pipetteG, graphY + 1. * s);
cr->move_to (graphX + graphW * static_cast<double>(pipetteG), graphY + 1. * s);
cr->rel_line_to (0, -graphH - 1. * s);
cr->stroke ();
}
if (pipetteB > -1.f) {
cr->set_source_rgba (0., 0., 1., 0.5); // WARNING: assuming that blue values are stored in pipetteB, which might not be the case!
cr->move_to (graphX + graphW*pipetteB, graphY + 1. * s);
cr->move_to (graphX + graphW * static_cast<double>(pipetteB), graphY + 1. * s);
cr->rel_line_to (0, -graphH - 1. * s);
cr->stroke ();
}
@@ -257,7 +257,7 @@ void MyFlatCurve::draw ()
cr->set_line_width (2. * s);
c = style->get_color (state);
cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue());
cr->move_to (graphX + graphW*pipetteVal, graphY + 1. * s);
cr->move_to (graphX + graphW * static_cast<double>(pipetteVal), graphY + 1. * s);
cr->rel_line_to (0, -graphH - 1. * s);
cr->stroke ();
cr->set_line_width (1. * s);
@@ -437,10 +437,10 @@ void MyFlatCurve::draw ()
// draw curve
c = style->get_color(state);
cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue());
cr->move_to (graphX, getVal(point, 0) * -graphH + graphY);
cr->move_to (graphX, static_cast<double>(getVal(point, 0)) * -graphH + graphY);
for (int i = 1; i < graphW; ++i) {
cr->line_to ((double)i + graphX, (double)getVal(point, i) * -graphH + graphY);
cr->line_to ((double)i + graphX, static_cast<double>(getVal(point, i)) * -graphH + graphY);
}
cr->stroke ();