From: Krzysztof KosiƄski Date: Wed, 20 Jan 2010 20:33:32 +0000 (+0100) Subject: Insert nodes on Ctrl+Alt+click on a path. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=58c5902626b1ba0feb295fab124de3160c73fbea;p=inkscape.git Insert nodes on Ctrl+Alt+click on a path. --- diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp index 0d1183ebf..57ae776e3 100644 --- a/src/ui/tool/curve-drag-point.cpp +++ b/src/ui/tool/curve-drag-point.cpp @@ -116,6 +116,12 @@ bool CurveDragPoint::_clickedHandler(GdkEventButton *event) NodeList::iterator second = first.next(); if (!second) return false; + // insert nodes on Ctrl+Alt+click + if (held_control(*event) && held_alt(*event)) { + _insertNode(false); + return true; + } + if (held_shift(*event)) { // if both nodes of the segment are selected, deselect; // otherwise add to selection @@ -138,18 +144,24 @@ bool CurveDragPoint::_clickedHandler(GdkEventButton *event) bool CurveDragPoint::_doubleclickedHandler(GdkEventButton *event) { if (event->button != 1 || !first || !first.next()) return false; + _insertNode(true); + return true; +} +void CurveDragPoint::_insertNode(bool take_selection) +{ // The purpose of this call is to make way for the just created node. // Otherwise clicks on the new node would only work after the user moves the mouse a bit. // PathManipulator will restore visibility when necessary. setVisible(false); NodeList::iterator inserted = _pm.subdivideSegment(first, _t); - _pm._selection.clear(); + if (take_selection) { + _pm._selection.clear(); + } _pm._selection.insert(inserted.ptr()); signal_update.emit(); _pm._commit(_("Add node")); - return true; } Glib::ustring CurveDragPoint::_getTip(unsigned state) diff --git a/src/ui/tool/curve-drag-point.h b/src/ui/tool/curve-drag-point.h index c9f32f709..51382615e 100644 --- a/src/ui/tool/curve-drag-point.h +++ b/src/ui/tool/curve-drag-point.h @@ -36,6 +36,7 @@ private: bool _clickedHandler(GdkEventButton *); bool _doubleclickedHandler(GdkEventButton *); void _ungrabbedHandler(); + void _insertNode(bool take_selection); double _t; PathManipulator &_pm; NodeList::iterator first;