aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-14 09:03:18 +0000
committerDavid Robillard <d@drobilla.net>2013-01-14 09:03:18 +0000
commit363eff1806154d5dae2a8374ef80e8319ab53e91 (patch)
tree323a888d6c5452b984234267d6eee8f73f327d73
parent0a02e807beea6104248cb6cf00ef6689c9231912 (diff)
downloadmachina-363eff1806154d5dae2a8374ef80e8319ab53e91.tar.gz
machina-363eff1806154d5dae2a8374ef80e8319ab53e91.tar.bz2
machina-363eff1806154d5dae2a8374ef80e8319ab53e91.zip
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
-rw-r--r--src/gui/MachinaCanvas.cpp7
1 files changed, 3 insertions, 4 deletions
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<NodeView*>(Glib::wrap(node));
- if (!view) {
- std::cerr << "error: Connect of node with no view" << std::endl;
+ MachinaCanvas* canvas = (MachinaCanvas*)data;
+ NodeView* view = dynamic_cast<NodeView*>(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;