From 63a289ce43e3916b93d378735d692af0f05d7b2f Mon Sep 17 00:00:00 2001 From: mjwybrow Date: Thu, 1 Feb 2007 05:40:58 +0000 Subject: [PATCH] * src/connector-context.cpp: Allow canceling of Connector Endpoint dragging when the user hits Escape. This is now more consistent with the rest of Inkscape's tools. --- src/connector-context.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/connector-context.cpp b/src/connector-context.cpp index 9d15ce10a..644aa0577 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -742,7 +742,26 @@ connector_handle_key_press(SPConnectorContext *const cc, guint const keyval) } break; case GDK_Escape: - if (cc->npoints != 0) { + if (cc->state == SP_CONNECTOR_CONTEXT_REROUTING) { + SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc); + SPDocument *doc = sp_desktop_document(desktop); + // Clear the temporary path: + sp_curve_reset(cc->red_curve); + sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(cc->red_bpath), NULL); + + cc->clickeditem->setHidden(false); + sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR, + _("Reroute connector")); + cc_set_active_conn(cc, cc->clickeditem); + + cc->state = SP_CONNECTOR_CONTEXT_IDLE; + + sp_document_undo(doc); + desktop->messageStack()->flash( Inkscape::NORMAL_MESSAGE, + _("Connector endpoint drag canceled.")); + ret = TRUE; + } + else if (cc->npoints != 0) { // if drawing, cancel, otherwise pass it up for deselecting cc->state = SP_CONNECTOR_CONTEXT_STOP; spcc_reset_colors(cc); -- 2.30.2