diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2012-02-01 02:17:34 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2012-02-01 02:17:34 +0000 |
| commit | 14625ba1f16c4d181d40358c2fd746e30715cb39 (patch) | |
| tree | 1fa6c94c4c3284681ebc22a5948d6bd141da2707 /src/ui/tool/node.cpp | |
| parent | Implement cancellations of drags with ESC in the node tool (diff) | |
| download | inkscape-14625ba1f16c4d181d40358c2fd746e30715cb39.tar.gz inkscape-14625ba1f16c4d181d40358c2fd746e30715cb39.zip | |
Additional fixes for drag cancellation in the node tool
(bzr r10926)
Diffstat (limited to 'src/ui/tool/node.cpp')
| -rw-r--r-- | src/ui/tool/node.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 2dc55e31c..4df4ba30e 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -351,13 +351,16 @@ void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) void Handle::ungrabbed(GdkEventButton *event) { // hide the handle if it's less than dragtolerance away from the node - // TODO is this actually desired? - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - int drag_tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); + // however, never do this for cancelled drag / broken grab + // TODO is this actually a good idea? + if (event) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + int drag_tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); - Geom::Point dist = _desktop->d2w(_parent->position()) - _desktop->d2w(position()); - if (dist.length() <= drag_tolerance) { - move(_parent->position()); + Geom::Point dist = _desktop->d2w(_parent->position()) - _desktop->d2w(position()); + if (dist.length() <= drag_tolerance) { + move(_parent->position()); + } } // HACK: If the handle was dragged out, call parent's ungrabbed handler, |
