diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-09-29 01:50:36 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-09-29 01:50:36 +0000 |
| commit | 389581f8c8a49e7cd922a09e0088e1414a7db05b (patch) | |
| tree | 3882bd125db1fd5feb655cb1886396a73a2898dd /src | |
| parent | Add helper paths to BSPline (diff) | |
| download | inkscape-389581f8c8a49e7cd922a09e0088e1414a7db05b.tar.gz inkscape-389581f8c8a49e7cd922a09e0088e1414a7db05b.zip | |
This push add suport to helper paths redraw to nodes, handles and knots.
This redraw at mouse movement. Whith knots also redraw at button release event
(bzr r13341.1.227)
Diffstat (limited to 'src')
| -rw-r--r-- | src/knot.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tool/node.cpp | 11 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/knot.cpp b/src/knot.cpp index 49b4dbb54..4476ad424 100644 --- a/src/knot.cpp +++ b/src/knot.cpp @@ -27,7 +27,9 @@ #include "preferences.h" #include "message-stack.h" #include "message-context.h" +#include "tools-switch.h" #include "ui/tools/tool-base.h" +#include "ui/tools/node-tool.h" #include <gtk/gtk.h> using Inkscape::DocumentUndo; @@ -261,6 +263,10 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot consumed = TRUE; } } + if (tools_isactive(knot->desktop, TOOLS_NODES)) { + Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(knot->desktop->event_context); + nt->update_helperpath(); + } break; case GDK_MOTION_NOTIFY: if (grabbed && knot->desktop && knot->desktop->event_context && !knot->desktop->event_context->space_panning) { @@ -293,6 +299,10 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot sp_knot_handler_request_position(event, knot); moved = TRUE; } + if (tools_isactive(knot->desktop, TOOLS_NODES)) { + Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(knot->desktop->event_context); + nt->update_helperpath(); + } break; case GDK_ENTER_NOTIFY: knot->setFlag(SP_KNOT_MOUSEOVER, TRUE); diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index c52bd4c07..5d6e96588 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -27,10 +27,11 @@ #include "ui/tool/event-utils.h" #include "ui/tool/node.h" #include "ui/tool/path-manipulator.h" +#include "ui/tools/node-tool.h" +#include "tools-switch.h" #include <gdk/gdkkeysyms.h> #include <cmath> - namespace { Inkscape::ControlType nodeTypeToCtrlType(Inkscape::UI::NodeType type) @@ -329,6 +330,10 @@ bool Handle::grabbed(GdkEventMotion *) void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) { + if (tools_isactive(_desktop, TOOLS_NODES)) { + Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(_desktop->event_context); + nt->update_helperpath(); + } Geom::Point parent_pos = _parent->position(); Geom::Point origin = _last_drag_origin(); SnapManager &sm = _desktop->namedview->snap_manager; @@ -1222,6 +1227,10 @@ bool Node::grabbed(GdkEventMotion *event) void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) { + if (tools_isactive(_desktop, TOOLS_NODES)) { + Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(_desktop->event_context); + nt->update_helperpath(); + } // For a note on how snapping is implemented in Inkscape, see snap.h. SnapManager &sm = _desktop->namedview->snap_manager; // even if we won't really snap, we might still call the one of the |
