Solving issue 2341: "Pipette and flat curves - no line colors"

This commit is contained in:
Hombre
2014-04-23 22:22:34 +02:00
parent 0fde2ec06d
commit 402c5a6af9
7 changed files with 89 additions and 40 deletions

View File

@@ -205,8 +205,9 @@ void MyFlatCurve::draw () {
cr->set_line_width (1.);
}
}
// draw the color feedback of the control points
else if (colorProvider) {
if (colorProvider) {
//if (curve.type!=FCT_Parametric)
for (int i=0; i<(int)curve.x.size(); ++i) {
@@ -919,23 +920,27 @@ void MyFlatCurve::pipetteMouseOver (EditDataProvider *provider, int modifierKey)
pipetteG = provider->pipetteVal[1];
pipetteB = provider->pipetteVal[2];
pipetteVal = 0.f;
int n = 0;
if (pipetteR != -1.f) {
pipetteVal += pipetteR;
++n;
if (listener)
pipetteVal = listener->blendPipetteValues(pipetteR, pipetteG, pipetteB);
else {
int n = 0;
if (pipetteR != -1.f) {
pipetteVal += pipetteR;
++n;
}
if (pipetteG != -1.f) {
pipetteVal += pipetteG;
++n;
}
if (pipetteB != -1.f) {
pipetteVal += pipetteB;
++n;
}
if (n>1)
pipetteVal /= n;
else if (!n)
pipetteVal = -1.f;
}
if (pipetteG != -1.f) {
pipetteVal += pipetteG;
++n;
}
if (pipetteB != -1.f) {
pipetteVal += pipetteB;
++n;
}
if (n>1)
pipetteVal /= n;
else if (!n)
pipetteVal = -1.f;
snapToElmt = -100;