From f23539d5acecf822bf585a449ffca0470000d6a9 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 22 Aug 2010 09:33:26 +0200 Subject: [PATCH] Snapmanager in pencil tool: setup() must be followed by unSetup() to clear pointers --- src/pencil-context.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp index 845f22a21..5d89c9715 100644 --- a/src/pencil-context.cpp +++ b/src/pencil-context.cpp @@ -263,13 +263,14 @@ pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &beve default: /* Set first point of sequence */ SnapManager &m = desktop->namedview->snap_manager; - m.setup(desktop); if (bevent.state & GDK_CONTROL_MASK) { + m.setup(desktop); if (!(bevent.state & GDK_SHIFT_MASK)) { m.freeSnapReturnByRef(p, Inkscape::SNAPSOURCE_NODE_HANDLE); } spdc_create_single_dot(event_context, p, "/tools/freehand/pencil", bevent.state); + m.unSetup(); ret = true; break; } @@ -277,7 +278,7 @@ pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &beve p = anchor->dp; desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Continuing selected path")); } else { - + m.setup(desktop); if (!(bevent.state & GDK_SHIFT_MASK)) { // This is the first click of a new curve; deselect item so that // this curve is not combined with it (unless it is drawn from its @@ -289,8 +290,8 @@ pencil_handle_button_press(SPPencilContext *const pc, GdkEventButton const &beve desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Appending to selected path")); m.freeSnapReturnByRef(p, Inkscape::SNAPSOURCE_NODE_HANDLE); } + m.unSetup(); } - m.unSetup(); pc->sa = anchor; spdc_set_startpoint(pc, p); ret = TRUE; -- 2.30.2