diff options
| -rw-r--r-- | src/knot.cpp | 1 | ||||
| -rw-r--r-- | src/knotholder.cpp | 1 | ||||
| -rw-r--r-- | src/ui/dialog/filter-editor.cpp | 2 | ||||
| -rw-r--r-- | src/ui/shape-editor.cpp | 12 | ||||
| -rw-r--r-- | src/ui/tools/node-tool.h | 2 | ||||
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 20 |
6 files changed, 23 insertions, 15 deletions
diff --git a/src/knot.cpp b/src/knot.cpp index e44efde4f..2d6bf2864 100644 --- a/src/knot.cpp +++ b/src/knot.cpp @@ -248,6 +248,7 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot if (moved) { knot->setFlag(SP_KNOT_DRAGGING, FALSE); knot->ungrabbed_signal.emit(knot, event->button.state); + knot->selectKnot(true); } else { knot->click_signal.emit(knot, event->button.state); } diff --git a/src/knotholder.cpp b/src/knotholder.cpp index 681667aa5..3ac983cca 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -174,7 +174,6 @@ void KnotHolder::transform_selected(Geom::Affine transform){ for (std::list<KnotHolderEntity *>::iterator i = entity.begin(); i != entity.end(); ++i) { SPKnot *knot = (*i)->knot; - std::cout << transform << "transform\n"; if (knot->flags & SP_KNOT_SELECTED) { knot_moved_handler(knot, knot->pos * transform , 0); knot->selectKnot(true); diff --git a/src/ui/dialog/filter-editor.cpp b/src/ui/dialog/filter-editor.cpp index 730f8175c..1b532578d 100644 --- a/src/ui/dialog/filter-editor.cpp +++ b/src/ui/dialog/filter-editor.cpp @@ -85,7 +85,7 @@ FilterEditorDialog::FilterEditorDialog() : UI::Widget::Panel("", "/dialogs/filte for(std::string w:req_widgets) { builder->get_widget(w,test); if(!test){ - g_warning("Required widget %s does not exist", w); + g_warning("Required widget %s does not exist", w.c_str()); return; } } diff --git a/src/ui/shape-editor.cpp b/src/ui/shape-editor.cpp index 288c6dc5e..51ea959cd 100644 --- a/src/ui/shape-editor.cpp +++ b/src/ui/shape-editor.cpp @@ -97,11 +97,11 @@ void ShapeEditor::event_attr_changed(Inkscape::XML::Node * node, gchar const *na // this can happen if an LPEItem's knotholder handle was dragged, in which case we want // to keep the knotholder; in all other cases (e.g., if the LPE itself changes) we delete it sh->reset_item(!strcmp(name, "d") || - !strcmp(node->name(),"svg:rect") );//|| -// !strcmp(node->name(),"svg:star") || -// !strcmp(node->name(),"svg:spiral") || -// !strcmp(node->name(),"svg:ellipse") || -// SP_IS_GENERICELLIPSE(SP_ACTIVE_DOCUMENT->getObjectById(node->attribute("id")))); + !strcmp(node->name(),"svg:rect") || + !strcmp(node->name(),"svg:star") | + !strcmp(node->name(),"svg:spiral") || + !strcmp(node->name(),"svg:ellipse") || + SP_IS_GENERICELLIPSE(SP_ACTIVE_DOCUMENT->getObjectById(node->attribute("id")))); } } } @@ -119,7 +119,6 @@ void ShapeEditor::set_item(SPItem *item, bool keep_knotholder) { if (_blockSetItem) { return; } - // this happens (and should only happen) when for an LPEItem having both knotholder and // nodepath the knotholder is adapted; in this case we don't want to delete the knotholder // since this freezes the handles @@ -162,6 +161,7 @@ bool ShapeEditor::knot_mouseover() const { if (this->knotholder) { return knotholder->knot_mouseover(); } + return false; } diff --git a/src/ui/tools/node-tool.h b/src/ui/tools/node-tool.h index 983ba6cee..dded2d9bd 100644 --- a/src/ui/tools/node-tool.h +++ b/src/ui/tools/node-tool.h @@ -61,6 +61,7 @@ public: virtual bool root_handler(GdkEvent* event); virtual const std::string& getPrefsPath(); + boost::ptr_map<SPItem*, ShapeEditor> _shape_editors; private: sigc::connection _selection_changed_connection; @@ -74,7 +75,6 @@ private: Inkscape::UI::PathSharedData* _path_data; SPCanvasGroup *_transform_handle_group; SPItem *_last_over; - boost::ptr_map<SPItem*, ShapeEditor> _shape_editors; bool cursor_drag; bool show_handles; 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. |
