summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjwybrow <mjwybrow@users.sourceforge.net>2007-02-01 05:40:58 +0000
committermjwybrow <mjwybrow@users.sourceforge.net>2007-02-01 05:40:58 +0000
commitd0cd8a1ec481f2ae1e9b3b2bbd84d6085e92b7cb (patch)
treeecd6ea4414422ebd605b01f944be88f2b5b60a26
parent* autogen.sh: Improve the versionCheck test to be more portable. (diff)
downloadinkscape-d0cd8a1ec481f2ae1e9b3b2bbd84d6085e92b7cb.tar.gz
inkscape-d0cd8a1ec481f2ae1e9b3b2bbd84d6085e92b7cb.zip
* 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. (bzr r2308)
-rw-r--r--src/connector-context.cpp21
1 files changed, 20 insertions, 1 deletions
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);