From: dvlierop2 Date: Mon, 20 Apr 2009 20:43:21 +0000 (+0000) Subject: Correctly trigger any pending snap events when the mouse button is released after... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1d91d4e5402a0860a621cc5814853134b52a3627;p=inkscape.git Correctly trigger any pending snap events when the mouse button is released after dragging a knot (i.e. after scaling/stretching/etc). The code was already there but executed in the wrong order --- diff --git a/src/knot.cpp b/src/knot.cpp index 5c821f909..1ac5d887b 100644 --- a/src/knot.cpp +++ b/src/knot.cpp @@ -325,18 +325,20 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot } break; case GDK_BUTTON_RELEASE: - if (event->button.button == 1 && !knot->desktop->event_context->space_panning) { - if (snap_delay_temporarily_active) { + if (event->button.button == 1 && !knot->desktop->event_context->space_panning) { + // If we have any pending snap event, then invoke it now + if (knot->desktop->event_context->_delayed_snap_event) { + sp_event_context_snap_watchdog_callback(knot->desktop->event_context->_delayed_snap_event); + } + + // now we can safely close the snapping window + if (snap_delay_temporarily_active) { if (knot->desktop->event_context->_snap_window_open == true) { sp_event_context_snap_window_closed(knot->desktop->event_context); } snap_delay_temporarily_active = false; } - if (knot->desktop->event_context->_delayed_snap_event) { - sp_event_context_snap_watchdog_callback(knot->desktop->event_context->_delayed_snap_event); - } - knot->pressure = 0; if (transform_escaped) { transform_escaped = false;