summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 28a43cd)
raw | patch | inline | side by side (parent: 28a43cd)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sat, 6 Nov 2010 23:09:40 +0000 (00:09 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sat, 6 Nov 2010 23:09:40 +0000 (00:09 +0100) |
of already cusp nodes to cusp in the node tool
src/ui/tool/multi-path-manipulator.cpp | patch | blob | history | |
src/ui/tool/node.cpp | patch | blob | history |
index 6101a35567da7d69d0095a707fc719cf0c26bb06..a1b398bb1cbdcfce07865b20fb80ac1167ba946d 100644 (file)
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)
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;
}
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index 399fa529238bfd149dd3b9100493377972bbfb48..60b5812c69c720003c67e7e34e8e4ff03620d43f 100644 (file)
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
if (update_handles) {
switch (type) {
case NODE_CUSP:
- // if the existing type is also NODE_CUSP, retract handles
- // NOTE: This misfeature is very annoying when you have both cusp and smooth
- // nodes in a selection, so I have removed it. Use segment commands
- // or Ctrl+click to retract handles.
- //if (_type == NODE_CUSP) {
- // _front.retract();
- // _back.retract();
- //}
+ // nothing to do
break;
case NODE_AUTO:
// auto handles make no sense for endnodes