Various bugfix:
- pipette buttons are now mutually exclusive - pipette from L curve (Lab tool) now works properly - pipette from B curve (RGB tool) now works properly - curve that doesn't handle the pipette mechanism hides the pipette button - RGB components of the Tone Curves' pipette now displayed in red, green & blue - the vertical line where the point will be inserted is displayed in grey and has a line's width of 2 pixels
This commit is contained in:
@@ -226,12 +226,8 @@ void MyDiagonalCurve::draw (int handle) {
|
||||
cr->fill ();
|
||||
}
|
||||
|
||||
c = style->get_fg (state);
|
||||
|
||||
// draw the pipette values
|
||||
if (pipetteR > -1.f || pipetteG > -1.f || pipetteB > -1.f) {
|
||||
cr->set_line_width (0.75);
|
||||
cr->set_source_rgb (c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
int n=0;
|
||||
if (pipetteR > -1.f) ++n;
|
||||
if (pipetteG > -1.f) ++n;
|
||||
@@ -239,29 +235,37 @@ 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 (double(graphX)+1.5 + double(graphW-3)*pipetteR, double(graphY)-1.5);
|
||||
cr->rel_line_to (0, double(-graphH+3));
|
||||
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 (double(graphX)+1.5 + double(graphW-3)*pipetteG, double(graphY)-1.5);
|
||||
cr->rel_line_to (0, double(-graphH+3));
|
||||
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 (double(graphX)+1.5 + double(graphW-3)*pipetteB, double(graphY)-1.5);
|
||||
cr->rel_line_to (0, double(-graphH+3));
|
||||
cr->stroke ();
|
||||
}
|
||||
}
|
||||
if (pipetteVal > -1.f) {
|
||||
cr->set_source_rgb (1., 0., 0.);
|
||||
cr->set_line_width (2.);
|
||||
c = style->get_fg (state);
|
||||
cr->set_source_rgb (c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
cr->move_to (double(graphX)+1.5 + double(graphW-3)*pipetteVal, double(graphY)-1.5);
|
||||
cr->rel_line_to (0, double(-graphH+3));
|
||||
cr->stroke ();
|
||||
cr->set_line_width (1.);
|
||||
}
|
||||
}
|
||||
|
||||
c = style->get_fg (state);
|
||||
|
||||
// draw the cage of the NURBS curve
|
||||
if (curve.type==DCT_NURBS) {
|
||||
unsigned int nbPoints;
|
||||
@@ -519,6 +523,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) {
|
||||
if (grab_point == -1) {
|
||||
new_type = CSArrow;
|
||||
lit_point = -1;
|
||||
pipetteR = pipetteG = pipetteB = -1.f;
|
||||
setDirty(true);
|
||||
draw (lit_point);
|
||||
}
|
||||
@@ -665,6 +670,13 @@ CursorShape MyDiagonalCurve::motionNotify(CursorShape type, double minDistanceX,
|
||||
}
|
||||
|
||||
void MyDiagonalCurve::pipetteMouseOver (EditDataProvider *provider, int modifierKey) {
|
||||
if (!provider) {
|
||||
// occurs when leaving the preview area -> cleanup the curve editor
|
||||
pipetteR = pipetteG = pipetteB = -1.f;
|
||||
lit_point = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
pipetteR = provider->pipetteVal[0];
|
||||
pipetteG = provider->pipetteVal[1];
|
||||
pipetteB = provider->pipetteVal[2];
|
||||
|
Reference in New Issue
Block a user