summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/control-point.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-03-03 00:35:08 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-03-03 00:35:08 +0000
commit8185d401d6c44431722218a05645bde4f8290e2f (patch)
tree58fc32603121de287de113cc06d0cee64797b6ab /src/ui/tool/control-point.cpp
parentNode tool: implement sculpting (diff)
downloadinkscape-8185d401d6c44431722218a05645bde4f8290e2f.tar.gz
inkscape-8185d401d6c44431722218a05645bde4f8290e2f.zip
Clean up control point event handling slightly
(bzr r9132)
Diffstat (limited to 'src/ui/tool/control-point.cpp')
-rw-r--r--src/ui/tool/control-point.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp
index b9a793ca4..b74e3bc9c 100644
--- a/src/ui/tool/control-point.cpp
+++ b/src/ui/tool/control-point.cpp
@@ -313,12 +313,7 @@ bool ControlPoint::_eventHandler(GdkEvent *event)
int drag_tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100);
switch(event->type)
- {
- case GDK_2BUTTON_PRESS:
- // store the button number for next release
- next_release_doubleclick = event->button.button;
- return true;
-
+ {
case GDK_BUTTON_PRESS:
next_release_doubleclick = 0;
if (event->button.button == 1) {
@@ -335,6 +330,11 @@ bool ControlPoint::_eventHandler(GdkEvent *event)
return true;
}
return false;
+
+ case GDK_2BUTTON_PRESS:
+ // store the button number for next release
+ next_release_doubleclick = event->button.button;
+ return true;
case GDK_MOTION_NOTIFY:
combine_motion_events(_desktop->canvas, event->motion, 0);
@@ -347,7 +347,6 @@ bool ControlPoint::_eventHandler(GdkEvent *event)
if (t) return true;
// if we are here, it means the tolerance was just exceeded.
- next_release_doubleclick = 0;
_drag_origin = _position;
transferred = grabbed(&event->motion);
// _drag_initiated might change during the above virtual call
@@ -396,22 +395,19 @@ bool ControlPoint::_eventHandler(GdkEvent *event)
sp_canvas_end_forced_full_redraws(_desktop->canvas);
}
- if (next_release_doubleclick) {
+ if (_drag_initiated) {
+ // it is the end of a drag
_drag_initiated = false;
- return doubleclicked(&event->button);
- }
- if (event->button.button == 1) {
- if (_drag_initiated) {
- // it is the end of a drag
- ungrabbed(&event->button);
- _drag_initiated = false;
- return true;
+ ungrabbed(&event->button);
+ return true;
+ } else {
+ // it is the end of a click
+ if (next_release_doubleclick) {
+ return doubleclicked(&event->button);
} else {
- // it is the end of a click
return clicked(&event->button);
}
}
- _drag_initiated = false;
}
break;