summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/tool-base.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-07-01 12:24:30 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-07-01 12:24:30 +0000
commitcb312127f49aae8d0f936743ce864a8e9143f558 (patch)
treec08a21584aa728f805be98a0c35891fe54d0e608 /src/ui/tools/tool-base.cpp
parentMerge https://gitlab.com/inkscape/inkscape into selectable-knots (diff)
downloadinkscape-cb312127f49aae8d0f936743ce864a8e9143f558.tar.gz
inkscape-cb312127f49aae8d0f936743ce864a8e9143f558.zip
Finish add selectable knot shapes
Diffstat (limited to 'src/ui/tools/tool-base.cpp')
-rw-r--r--src/ui/tools/tool-base.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp
index 9d08cfcb6..ddd7c19c4 100644
--- a/src/ui/tools/tool-base.cpp
+++ b/src/ui/tools/tool-base.cpp
@@ -33,6 +33,8 @@
#include "ui/tools/lpe-tool.h"
#include "ui/tool/commit-events.h"
#include "ui/tool/event-utils.h"
+#include "ui/tools/node-tool.h"
+#include "ui/tool/shape-record.h"
#include <gdk/gdkkeysyms.h>
#include <glibmm/i18n.h>
@@ -321,14 +323,21 @@ bool ToolBase::_keyboardMove(GdkEventKey const &event, Geom::Point const &dir)
double nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000, "px");
delta *= nudge;
}
- std::cout << num << "zzzzzzzzzzzzzzzzzzzzzzzzzzzwww\n";
- if (this->shape_editor && this->shape_editor->has_knotholder()) {
- std::cout << num << "zzzzzzzzzzzzzzzzzzzzzzzzzzz\n";
+ if (shape_editor && shape_editor->has_knotholder()) {
KnotHolder * knotholder = shape_editor->knotholder;
if (knotholder) {
- std::cout << num << "wwwwwwwwwwwwwwwwwwwwww\n";
knotholder->transform_selected(Geom::Translate(delta));
}
+ } else {
+ Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(desktop->event_context);
+ if (nt) {
+ for(auto i=nt->_shape_editors.begin();i!=nt->_shape_editors.end();++i){
+ KnotHolder * knotholder = i->second->knotholder;
+ if (knotholder) {
+ knotholder->transform_selected(Geom::Translate(delta));
+ }
+ }
+ }
}
return true;
}
@@ -588,8 +597,7 @@ bool ToolBase::root_handler(GdkEvent* event) {
int const key_scroll = prefs->getIntLimited("/options/keyscroll/value",
10, 0, 1000);
- switch(shortcut_key(event->key)) {
- //switch (get_group0_keyval(&event->key)) {
+ switch (get_group0_keyval(&event->key)) {
// GDK insists on stealing these keys (F1 for no idea what, tab for cycling widgets
// in the editing window). So we resteal them back and run our regular shortcut
// invoker on them.