Bug corrected in the curve editor (pen device handling)

This commit is contained in:
Hombre
2010-08-18 23:36:10 +02:00
parent 964f623de5
commit dc4deeab0c
2 changed files with 41 additions and 49 deletions

View File

@@ -30,10 +30,9 @@ MyCurve::MyCurve () : listener(NULL), activeParam(-1), bghistvalid(false) {
prevInnerHeight = innerHeight;
grab_point = -1;
lit_point = -1;
source = GDK_SOURCE_MOUSE;
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);
signal_event().connect( sigc::mem_fun(*this, &MyCurve::handleEvents) );
@@ -298,10 +297,6 @@ bool MyCurve::handleEvents (GdkEvent* event) {
buttonPressed = true;
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
getCursorPosition(event);
findClosestPoint();
@@ -339,7 +334,6 @@ bool MyCurve::handleEvents (GdkEvent* event) {
case Gdk::BUTTON_RELEASE:
if (curve.type!=Parametric) {
if (event->button.device->source == source) {
if (event->button.button == 1) {
buttonPressed = false;
}
@@ -386,7 +380,6 @@ bool MyCurve::handleEvents (GdkEvent* event) {
notifyListener ();
}
}
}
break;
case Gdk::LEAVE_NOTIFY:

View File

@@ -80,7 +80,6 @@ class MyCurve : public Gtk::DrawingArea {
double distanceY; // Y distance from the cursor to the closest point
double ugpX; // unclamped grabbed point X 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> upoint;
std::vector<Gdk::Point> lpoint;