From 363eff1806154d5dae2a8374ef80e8319ab53e91 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 14 Jan 2013 09:03:18 +0000 Subject: Fix creation of broken arcs when double clicking nodes. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4985 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/MachinaCanvas.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index 6de0217..243930f 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -49,12 +49,11 @@ MachinaCanvas::MachinaCanvas(MachinaGUI* app, int width, int height) void MachinaCanvas::connect_nodes(GanvNode* node, void* data) { - NodeView* view = dynamic_cast(Glib::wrap(node)); - if (!view) { - std::cerr << "error: Connect of node with no view" << std::endl; + MachinaCanvas* canvas = (MachinaCanvas*)data; + NodeView* view = dynamic_cast(Glib::wrap(node)); + if (!view || view == canvas->_connect_node) { return; } - MachinaCanvas* canvas = (MachinaCanvas*)data; if (canvas->get_edge(view, canvas->_connect_node)) { canvas->action_disconnect(view, canvas->_connect_node); canvas->_did_connect = true; -- cgit v1.2.1