Bug corrected in the curve editor (pen device handling)
This commit is contained in:
@@ -30,10 +30,9 @@ MyCurve::MyCurve () : listener(NULL), activeParam(-1), bghistvalid(false) {
|
|||||||
prevInnerHeight = innerHeight;
|
prevInnerHeight = innerHeight;
|
||||||
grab_point = -1;
|
grab_point = -1;
|
||||||
lit_point = -1;
|
lit_point = -1;
|
||||||
source = GDK_SOURCE_MOUSE;
|
|
||||||
buttonPressed = false;
|
buttonPressed = false;
|
||||||
|
|
||||||
set_extension_events(Gdk::EXTENSION_EVENTS_CURSOR);
|
set_extension_events(Gdk::EXTENSION_EVENTS_ALL);
|
||||||
add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK | Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::BUTTON1_MOTION_MASK);
|
add_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK | Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::BUTTON1_MOTION_MASK);
|
||||||
signal_event().connect( sigc::mem_fun(*this, &MyCurve::handleEvents) );
|
signal_event().connect( sigc::mem_fun(*this, &MyCurve::handleEvents) );
|
||||||
|
|
||||||
@@ -298,10 +297,6 @@ bool MyCurve::handleEvents (GdkEvent* event) {
|
|||||||
buttonPressed = true;
|
buttonPressed = true;
|
||||||
add_modal_grab ();
|
add_modal_grab ();
|
||||||
|
|
||||||
//we memorize the input device that "pressed" in the editor, to avoid unwanted motion from
|
|
||||||
//an eventual mouse connected
|
|
||||||
source = event->button.device->source;
|
|
||||||
|
|
||||||
// get the pointer position
|
// get the pointer position
|
||||||
getCursorPosition(event);
|
getCursorPosition(event);
|
||||||
findClosestPoint();
|
findClosestPoint();
|
||||||
@@ -339,7 +334,6 @@ bool MyCurve::handleEvents (GdkEvent* event) {
|
|||||||
|
|
||||||
case Gdk::BUTTON_RELEASE:
|
case Gdk::BUTTON_RELEASE:
|
||||||
if (curve.type!=Parametric) {
|
if (curve.type!=Parametric) {
|
||||||
if (event->button.device->source == source) {
|
|
||||||
if (event->button.button == 1) {
|
if (event->button.button == 1) {
|
||||||
buttonPressed = false;
|
buttonPressed = false;
|
||||||
}
|
}
|
||||||
@@ -386,7 +380,6 @@ bool MyCurve::handleEvents (GdkEvent* event) {
|
|||||||
notifyListener ();
|
notifyListener ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Gdk::LEAVE_NOTIFY:
|
case Gdk::LEAVE_NOTIFY:
|
||||||
|
@@ -80,7 +80,6 @@ class MyCurve : public Gtk::DrawingArea {
|
|||||||
double distanceY; // Y distance from the cursor to the closest point
|
double distanceY; // Y distance from the cursor to the closest point
|
||||||
double ugpX; // unclamped grabbed point X coordinate in the graph
|
double ugpX; // unclamped grabbed point X coordinate in the graph
|
||||||
double ugpY; // unclamped grabbed point Y coordinate in the graph
|
double ugpY; // unclamped grabbed point Y coordinate in the graph
|
||||||
GdkInputSource source;
|
|
||||||
std::vector<Gdk::Point> point;
|
std::vector<Gdk::Point> point;
|
||||||
std::vector<Gdk::Point> upoint;
|
std::vector<Gdk::Point> upoint;
|
||||||
std::vector<Gdk::Point> lpoint;
|
std::vector<Gdk::Point> lpoint;
|
||||||
|
Reference in New Issue
Block a user