summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/node.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-12-16 22:07:52 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-12-16 22:07:52 +0000
commitd18ee1bd701f1e78a42fc4253f7a5c4e7ece714a (patch)
tree7b62d3e3d71832d75c18b67771a5b413293a8683 /src/ui/tool/node.cpp
parentNode tool: fix snapping during constrained rotation of handles (diff)
downloadinkscape-d18ee1bd701f1e78a42fc4253f7a5c4e7ece714a.tar.gz
inkscape-d18ee1bd701f1e78a42fc4253f7a5c4e7ece714a.zip
Node tool: fix snapping of node rotation center
Fixed bugs: - https://launchpad.net/bugs/667072 (bzr r9960)
Diffstat (limited to 'src/ui/tool/node.cpp')
-rw-r--r--src/ui/tool/node.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index a79a5c409..fea02d399 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -227,6 +227,35 @@ char const *Handle::handle_type_to_localized_string(NodeType type)
}
}
+bool Handle::_eventHandler(GdkEvent *event)
+{
+ switch (event->type)
+ {
+ case GDK_KEY_PRESS:
+ switch (shortcut_key(event->key))
+ {
+ case GDK_s:
+ case GDK_S:
+ if (held_only_shift(event->key) && _parent->_type == NODE_CUSP) {
+ // when Shift+S is pressed when hovering over a handle belonging to a cusp node,
+ // hold this handle in place; otherwise process normally
+ // this handle is guaranteed not to be degenerate
+ other()->move(_parent->position() - (position() - _parent->position()));
+ _parent->setType(NODE_SMOOTH, false);
+ _parent->_pm().update(); // magic triple combo to add undo event
+ _parent->_pm().writeXML();
+ _parent->_pm()._commit(_("Change node type"));
+ return true;
+ }
+ break;
+ default: break;
+ }
+ default: break;
+ }
+
+ return ControlPoint::_eventHandler(event);
+}
+
bool Handle::grabbed(GdkEventMotion *)
{
_saved_other_pos = other()->position();