summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-01-20 20:33:32 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-01-20 20:33:32 +0000
commitf43c75a4031e151da89d4bf28c3bc30010154903 (patch)
tree62f05e205216f2d2ef5a543c434305ec430f2242 /src/ui
parentGo back to using TR1 unordered containers to fix warnings. Add configure (diff)
downloadinkscape-f43c75a4031e151da89d4bf28c3bc30010154903.tar.gz
inkscape-f43c75a4031e151da89d4bf28c3bc30010154903.zip
Insert nodes on Ctrl+Alt+click on a path.
(bzr r9007)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tool/curve-drag-point.cpp16
-rw-r--r--src/ui/tool/curve-drag-point.h1
2 files changed, 15 insertions, 2 deletions
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;