summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/multi-path-manipulator.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-11-06 23:09:40 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-11-06 23:09:40 +0000
commitc8c9ae21902c8603dd80be90d0b3b7851eef816d (patch)
treeffa0d5062bb5a85cefadd0af498faf6665a5e727 /src/ui/tool/multi-path-manipulator.cpp
parentDisable i18n of palettes for now - it breaks builds where srcdir != builddir (diff)
downloadinkscape-c8c9ae21902c8603dd80be90d0b3b7851eef816d.tar.gz
inkscape-c8c9ae21902c8603dd80be90d0b3b7851eef816d.zip
Reintroduce Shift+L shortcut and handle retraction when setting the type
of already cusp nodes to cusp in the node tool (bzr r9875)
Diffstat (limited to 'src/ui/tool/multi-path-manipulator.cpp')
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index 6101a3556..a1b398bb1 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -220,11 +220,29 @@ void MultiPathManipulator::invertSelectionInSubpaths()
void MultiPathManipulator::setNodeType(NodeType type)
{
if (_selection.empty()) return;
+
+ // When all selected nodes are already cusp, retract their handles
+ bool retract_handles = (type == NODE_CUSP);
+
for (ControlPointSelection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
Node *node = dynamic_cast<Node*>(*i);
- if (node) node->setType(type);
+ if (node) {
+ retract_handles &= (node->type() == NODE_CUSP);
+ node->setType(type);
+ }
}
- _done(_("Change node type"));
+
+ if (retract_handles) {
+ for (ControlPointSelection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
+ Node *node = dynamic_cast<Node*>(*i);
+ if (node) {
+ node->front()->retract();
+ node->back()->retract();
+ }
+ }
+ }
+
+ _done(retract_handles ? _("Retract handles") : _("Change node type"));
}
void MultiPathManipulator::setSegmentType(SegmentType type)
@@ -603,6 +621,13 @@ bool MultiPathManipulator::event(GdkEvent *event)
return true;
}
break;
+ case GDK_l:
+ case GDK_L:
+ if (held_only_shift(event->key)) {
+ // Shift+L - make segments linear
+ setSegmentType(SEGMENT_LINEAR);
+ return true;
+ }
default:
break;
}