The first point of the Flat curve editor was misbehaving when using the Shift modifier key
This commit is contained in:
@@ -28,30 +28,34 @@
|
||||
#include "guiutils.h"
|
||||
#include "options.h"
|
||||
|
||||
#define RADIUS 3 /* radius of the control points */
|
||||
#define CBAR_WIDTH_STD 13 /* width of the colored bar (border included) for standard themes */
|
||||
#define CBAR_WIDTH_SLIM 10 /* width of the colored bar (border included) for slim themes */
|
||||
#define CBAR_MARGIN 2 /* spacing between the colored bar and the graph */
|
||||
#define SQUARE 2 /* half length of the square shape of the tangent handles */
|
||||
#define MIN_DISTANCE 5 /* min distance between control points */
|
||||
#define GRAPH_SIZE 200 /* size of the curve editor graphic */
|
||||
#define RADIUS 3 /** radius of the control points */
|
||||
#define CBAR_WIDTH_STD 13 /** width of the colored bar (border included) for standard themes */
|
||||
#define CBAR_WIDTH_SLIM 10 /** width of the colored bar (border included) for slim themes */
|
||||
#define CBAR_MARGIN 2 /** spacing between the colored bar and the graph */
|
||||
#define SQUARE 2 /** half length of the square shape of the tangent handles */
|
||||
#define MIN_DISTANCE 5 /** min distance between control points */
|
||||
#define GRAPH_SIZE 200 /** size of the curve editor graphic */
|
||||
|
||||
// For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget
|
||||
/** @brief Flat or Diagonal curve type
|
||||
For compatibility and simplicity reason, order shouldn't change, and must be identical to the order specified in the curveType widget
|
||||
*/
|
||||
enum CurveType {
|
||||
CT_Flat,
|
||||
CT_Diagonal
|
||||
};
|
||||
|
||||
/** @brief Tells the type of element that the points snaps to
|
||||
*/
|
||||
enum SnapToType {
|
||||
ST_None,
|
||||
ST_Identity, // Point snapped to the identity curve
|
||||
ST_Neighbors // Point snapped to the neighbor points
|
||||
ST_None, /// The point is not snapped
|
||||
ST_Identity, /// Point snapped to the identity curve
|
||||
ST_Neighbors /// Point snapped to the neighbor points
|
||||
};
|
||||
|
||||
enum ResizeState {
|
||||
RS_Pending = 1, // Resize has to occure
|
||||
RS_Done = 2, // Resize has been done
|
||||
RS_Force = 4 // Resize has to occure even without CONFIGURE event
|
||||
RS_Pending = 1, /// Resize has to occurs
|
||||
RS_Done = 2, /// Resize has been done
|
||||
RS_Force = 4 /// Resize has to occurs even without CONFIGURE event
|
||||
};
|
||||
|
||||
class MyCurveIdleHelper;
|
||||
@@ -65,17 +69,17 @@ class MyCurve : public Gtk::DrawingArea, public BackBuffer, public ColorCaller {
|
||||
ColoredBar *leftBar;
|
||||
ColoredBar *bottomBar;
|
||||
CursorShape cursor_type;
|
||||
int graphX, graphY, graphW, graphH; // dimensions of the graphic area, excluding surrounding space for the points of for the colored bar
|
||||
int prevGraphW, prevGraphH; // previous inner width and height of the editor
|
||||
int graphX, graphY, graphW, graphH; /// dimensions of the graphic area, excluding surrounding space for the points of for the colored bar
|
||||
int prevGraphW, prevGraphH; /// previous inner width and height of the editor
|
||||
Gdk::ModifierType mod_type;
|
||||
int cursorX; // X coordinate in the graph of the cursor
|
||||
int cursorY; // Y coordinate in the graph of the cursor
|
||||
int cursorX; /// X coordinate in the graph of the cursor
|
||||
int cursorY; /// Y coordinate in the graph of the cursor
|
||||
std::vector< Point<float> > point;
|
||||
std::vector< Point<float> > upoint;
|
||||
std::vector< Point<float> > lpoint;
|
||||
bool buttonPressed;
|
||||
/*
|
||||
* snapToElmt must be interpreted like this:
|
||||
/**
|
||||
* snapToElmt, which will be used for the Y axis only, must be interpreted like this:
|
||||
* -100 : no element (default)
|
||||
* -3 : maximum value
|
||||
* -2 : identity value
|
||||
@@ -85,15 +89,16 @@ class MyCurve : public Gtk::DrawingArea, public BackBuffer, public ColorCaller {
|
||||
*/
|
||||
int snapToElmt;
|
||||
bool snapTo;
|
||||
double snapToMinDist;
|
||||
double snapToVal;
|
||||
double snapToMinDistX, snapToMinDistY;
|
||||
double snapToValX, snapToValY;
|
||||
MyCurveIdleHelper* mcih;
|
||||
enum ResizeState sized;
|
||||
bool curveIsDirty;
|
||||
|
||||
virtual std::vector<double> get_vector (int veclen) = 0;
|
||||
int getGraphMinSize() { return GRAPH_SIZE + RADIUS + 1; }
|
||||
bool snapCoordinate(double testedVal, double realVal);
|
||||
bool snapCoordinateX(double testedVal, double realVal);
|
||||
bool snapCoordinateY(double testedVal, double realVal);
|
||||
|
||||
// return value = new requested height
|
||||
int calcDimensions ();
|
||||
|
Reference in New Issue
Block a user