diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-01-20 14:14:37 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-01-20 14:14:37 +0000 |
| commit | e6b5fdce005681751c781326ec649f0882a4c13f (patch) | |
| tree | 4829c3dd4179f5768cb21305dfb87bb78655a662 | |
| parent | Small fix in scour (optimized SVG) output extension. (diff) | |
| download | inkscape-e6b5fdce005681751c781326ec649f0882a4c13f.tar.gz inkscape-e6b5fdce005681751c781326ec649f0882a4c13f.zip | |
Fix snapping in the node tool when more than one point is dragged.
(bzr r9001)
| -rw-r--r-- | src/ui/tool/control-point-selection.cpp | 18 | ||||
| -rw-r--r-- | src/ui/tool/selectable-control-point.cpp | 16 | ||||
| -rw-r--r-- | src/ui/tool/selectable-control-point.h | 2 |
3 files changed, 9 insertions, 27 deletions
diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index 2a3498d7f..d1ff5f9d8 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -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; diff --git a/src/ui/tool/selectable-control-point.cpp b/src/ui/tool/selectable-control-point.cpp index df2410dc2..9039bd533 100644 --- a/src/ui/tool/selectable-control-point.cpp +++ b/src/ui/tool/selectable-control-point.cpp @@ -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()) { diff --git a/src/ui/tool/selectable-control-point.h b/src/ui/tool/selectable-control-point.h index 208593e3f..f5e9541c3 100644 --- a/src/ui/tool/selectable-control-point.h +++ b/src/ui/tool/selectable-control-point.h @@ -51,8 +51,6 @@ private: void _takeSelection(); void _grabbedHandler(); - void _draggedHandler(Geom::Point const &, Geom::Point &, GdkEventMotion *); - void _ungrabbedHandler(); bool _clickedHandler(GdkEventButton *); }; |
