diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2011-11-04 21:30:19 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mail@diedenrezi.nl> | 2011-11-04 21:30:19 +0000 |
| commit | 224a99dc216119d34eb3ed13d12f123158acfe3c (patch) | |
| tree | cb012b688f276656612f2994e461fda3622bcd20 /src/ui/tool/control-point.cpp | |
| parent | Powerstroke: add erasing of knots with ctrl+alt (LPE parameter editing on-can... (diff) | |
| download | inkscape-224a99dc216119d34eb3ed13d12f123158acfe3c.tar.gz inkscape-224a99dc216119d34eb3ed13d12f123158acfe3c.zip | |
1) Cycle to the next-closest-snap-source when pressing tab, if the snap-closest-point-only-option has been activated. Works for the selector tool, but also when scaling/stretching/skewing a selection of nodes in the node tool
2) Cleanup and simplification of the code that finds the closest snapsource
(bzr r10720)
Diffstat (limited to 'src/ui/tool/control-point.cpp')
| -rw-r--r-- | src/ui/tool/control-point.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index 81cb53f6f..79d70d453 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -22,6 +22,7 @@ #include "preferences.h" #include "ui/tool/control-point.h" #include "ui/tool/event-utils.h" +#include "ui/tool/transform-handle-set.h" namespace Inkscape { namespace UI { @@ -437,6 +438,32 @@ bool ControlPoint::_eventHandler(GdkEvent *event) // update tips on modifier state change // TODO add ESC keybinding as drag cancel case GDK_KEY_PRESS: + switch (get_group0_keyval(&event->key)) + { + case GDK_Tab: + {// Downcast from ControlPoint to TransformHandle, if possible + // This is an ugly hack; we should have the transform handle intercept the keystrokes itself + TransformHandle *th = dynamic_cast<TransformHandle*>(this); + if (th) { + th->getNextClosestPoint(false); + return true; + } + break; + } + case GDK_ISO_Left_Tab: + {// Downcast from ControlPoint to TransformHandle, if possible + // This is an ugly hack; we should have the transform handle intercept the keystrokes itself + TransformHandle *th = dynamic_cast<TransformHandle*>(this); + if (th) { + th->getNextClosestPoint(true); + return true; + } + break; + } + default: + break; + } + // Do not break here, to allow for updating tooltips and such case GDK_KEY_RELEASE: if (mouseovered_point != this) return false; if (_drag_initiated) { |
