Code

Fix snapping in the node tool when more than one point is dragged.
authorKrzysztof Kosiński <tweenk.pl@gmail.com>
Wed, 20 Jan 2010 14:14:37 +0000 (15:14 +0100)
committerKrzysztof Kosiński <tweenk.pl@gmail.com>
Wed, 20 Jan 2010 14:14:37 +0000 (15:14 +0100)
src/ui/tool/control-point-selection.cpp
src/ui/tool/selectable-control-point.cpp
src/ui/tool/selectable-control-point.h

index 2a3498d7f8bdcd8b57151c0e82e38e9304f475ca..d1ff5f9d895ffcf4f1b558395a9483c899fa45c4 100644 (file)
@@ -81,26 +81,24 @@ std::pair<ControlPointSelection::iterator, bool> ControlPointSelection::insert(c
     boost::shared_ptr<connlist_type> clist(new connlist_type());
 
     // hide event param and always return false
-    /*clist->push_back(
+    clist->push_back(
         x->signal_grabbed.connect(
             sigc::bind_return(
-                sigc::bind<0>(
-                    sigc::mem_fun(*this, &ControlPointSelection::_selectionGrabbed),
-                    x),
+                sigc::hide(
+                    sigc::mem_fun(*this, &ControlPointSelection::_pointGrabbed)),
                 false)));
     clist->push_back(
         x->signal_dragged.connect(
-                sigc::mem_fun(*this, &ControlPointSelection::_selectionDragged)));
+                sigc::mem_fun(*this, &ControlPointSelection::_pointDragged)));
     clist->push_back(
         x->signal_ungrabbed.connect(
             sigc::hide(
-                sigc::mem_fun(*this, &ControlPointSelection::_selectionUngrabbed))));
+                sigc::mem_fun(*this, &ControlPointSelection::_pointUngrabbed))));
     clist->push_back(
         x->signal_clicked.connect(
-            sigc::hide(
-                sigc::bind<0>(
-                    sigc::mem_fun(*this, &ControlPointSelection::_selectionClicked),
-                    x))));*/
+            sigc::bind<0>(
+                sigc::mem_fun(*this, &ControlPointSelection::_pointClicked),
+                x)));
 
     found = _points.insert(std::make_pair(x, clist)).first;
 
index df2410dc29c5831cb719de33bb88342d3b0907c9..9039bd53320f81c4a699673ac0c9533d94ba085e 100644 (file)
@@ -61,11 +61,6 @@ void SelectableControlPoint::_connectHandlers()
             sigc::hide(
                 sigc::mem_fun(*this, &SelectableControlPoint::_grabbedHandler)),
             false));
-    signal_dragged.connect(
-        sigc::mem_fun(*this, &SelectableControlPoint::_draggedHandler));
-    signal_ungrabbed.connect(
-        sigc::hide(
-            sigc::mem_fun(*this, &SelectableControlPoint::_ungrabbedHandler)));
     signal_clicked.connect(
         sigc::mem_fun(*this, &SelectableControlPoint::_clickedHandler));
 }
@@ -75,20 +70,11 @@ void SelectableControlPoint::_grabbedHandler()
     // if a point is dragged while not selected, it should select itself
     if (!selected()) {
         _takeSelection();
-        _selection._pointGrabbed();
     }
 }
-void SelectableControlPoint::_draggedHandler(Geom::Point const &old_pos, Geom::Point &new_pos, GdkEventMotion *event)
-{
-    _selection._pointDragged(old_pos, new_pos, event);
-}
-void SelectableControlPoint::_ungrabbedHandler()
-{
-    _selection._pointUngrabbed();
-}
+
 bool SelectableControlPoint::_clickedHandler(GdkEventButton *event)
 {
-    if (selected() && _selection._pointClicked(this, event)) return true;
     if (event->button != 1) return false;
     if (held_shift(*event)) {
         if (selected()) {
index 208593e3fc2cb36eb160e2e1592864d88760fad6..f5e9541c30661f580f1789c28231d716eaf90b88 100644 (file)
@@ -51,8 +51,6 @@ private:
     void _takeSelection();
     
     void _grabbedHandler();
-    void _draggedHandler(Geom::Point const &, Geom::Point &, GdkEventMotion *);
-    void _ungrabbedHandler();
     bool _clickedHandler(GdkEventButton *);
 };