"SnapTo" feature enabled in the curve editor + non periodic handling of the flat curve editor.

Here is the new modifiew key behaviour :

    * CONTROL while dragging a point :
      slow down 20x the point move (i.e. 1pixel of cursor move move the control point by 0.05px)

    * SHIFT while dragging a point :
      snap the point to the following elements, on a "use nearest solution" method :
          o Diagonal curve editor :
                + top bound,
                + bottom bound,
                + identity (diagonal) line,
                + same Y than previous point,
                + same Y than next point,
                + line made by the previous and next point ; this will help to create linear parts in the curve more easilly
          o Flat curve editor (when moving a point) :
                + top bound,
                + bottom bound,
                + identity (horizontal) line,
                + same Y than previous point (or last point if you move the first point),
                + same Y than next point (or first point if you move the last point
          o Flat curve editor (when moving a tangential handle) :
                + 0.0, 0.35, 0.5, 1.0 values
                  0.35 is the default handles value and does create an smooth "diagonal" transition between points.
This commit is contained in:
Hombre
2011-04-18 15:40:22 +02:00
parent a6370306f7
commit 3de100ae5e
13 changed files with 258 additions and 80 deletions

View File

@@ -93,7 +93,7 @@ class MyFlatCurve : public MyCurve {
double minDistanceX; // X minimal distance before point suppression
double minDistanceY; // Y minimal distance before point suppression
double deletedPointX; // Backup of the X value of the edited point, when deleted while being dragged
HandlePosition leftTanHandle; // XY coordinate if the upper left and bottom right corner of the left tangent handle
HandlePosition leftTanHandle; // XY coordinate if the upper left and bottom right corner of the left tangent handle
HandlePosition rightTanHandle; // XY coordinate if the upper left and bottom right corner of the right tangent handle
bool tanHandlesDisplayed; // True if the tangent handles are displayed
bool periodic; // Flat curves are periodic by default
@@ -114,6 +114,7 @@ class MyFlatCurve : public MyCurve {
MyFlatCurve ();
//~MyFlatCurve ();
std::vector<double> getPoints ();
void setPeriodicity (bool isPeriodic) { periodic = isPeriodic; };
void setPoints (const std::vector<double>& p);
void setType (FlatCurveType t);
bool handleEvents (GdkEvent* event);