Adding Pipette feature for the Parametric curve + bugfix of the SnapTo feature

This commit is contained in:
Hombrenatureh.510
2014-03-15 03:15:44 +01:00
parent 518a318822
commit 1da9dda959
8 changed files with 89 additions and 24 deletions

View File

@@ -1062,11 +1062,11 @@ void MyFlatCurve::pipetteDrag(EditDataProvider *provider, int modifierKey) {
getMouseOverArea();
if (editedHandle == FCT_EditedHandle_CPointY) {
movePoint(false, true);
movePoint(false, true, true);
}
}
void MyFlatCurve::movePoint(bool moveX, bool moveY) {
void MyFlatCurve::movePoint(bool moveX, bool moveY, bool pipetteDrag) {
// bounds of the grabbed point
double leftBound;
@@ -1187,6 +1187,10 @@ void MyFlatCurve::movePoint(bool moveX, bool moveY) {
// we memorize the previous position of the point, for optimization purpose
ugpY += deltaY;
// the points stay in the bounds (and can't be deleted) in pipette drag mode
if (pipetteDrag)
ugpY = CLAMP(ugpY, 0.0, 1.0);
// snapping point to specific values
if (snapTo && curve.x[lit_point] != -1) {