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

@@ -358,14 +358,14 @@ void MyDiagonalCurve::draw (int handle)
// draw upper and lower bounds
if (curve.type == DCT_Parametric && activeParam > 0 && lpoint.getUpperBound() > 1 && upoint.getUpperBound() > 1) {
cr->set_source_rgba (1.0, 1.0, 1.0, 0.1);
cr->move_to (graphX, getVal(upoint, 0) * -graphH + graphY);
cr->move_to (graphX, static_cast<double>(getVal(upoint, 0)) * -graphH + graphY);
for (int i = 1; i < graphW - 2; ++i) {
cr->line_to ((double)i + graphX, getVal(upoint, i) * -graphH + graphY);
cr->line_to ((double)i + graphX, static_cast<double>(getVal(upoint, i)) * -graphH + graphY);
}
for (int i = graphW - 3; i >= 0; --i) {
cr->line_to ((double)i + graphX, getVal(lpoint, i) * -graphH + graphY);
cr->line_to ((double)i + graphX, static_cast<double>(getVal(lpoint, i)) * -graphH + graphY);
}
cr->fill ();
@@ -390,21 +390,21 @@ void MyDiagonalCurve::draw (int handle)
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 ();
}
@@ -414,7 +414,7 @@ void MyDiagonalCurve::draw (int handle)
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);
@@ -460,7 +460,7 @@ void MyDiagonalCurve::draw (int handle)
// draw curve
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);