diff options
author | David Robillard <d@drobilla.net> | 2014-01-03 01:08:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-01-03 01:08:49 +0000 |
commit | 9191aae81ab497d9cbf5a256b2b2e9dbf1af5d67 (patch) | |
tree | 2ea82730af0862baa33b921ea6bd6fe126b2d49e /src/Canvas.cpp | |
parent | a6aba9a3e541b8f193e93c653bac7bbae111de17 (diff) | |
download | ganv-9191aae81ab497d9cbf5a256b2b2e9dbf1af5d67.tar.gz ganv-9191aae81ab497d9cbf5a256b2b2e9dbf1af5d67.tar.bz2 ganv-9191aae81ab497d9cbf5a256b2b2e9dbf1af5d67.zip |
Make graph input ports controllable outputs and remove double port kludge.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5247 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/Canvas.cpp')
-rw-r--r-- | src/Canvas.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp index c70aaf3..ca28025 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -1408,7 +1408,13 @@ GanvCanvasImpl::port_event(GdkEvent* event, GanvPort* port) case GDK_BUTTON_PRESS: if (event->button.button == 1) { GanvModule* const module = ganv_port_get_module(port); - if (module && port->impl->is_input && port->impl->control) { + double port_x = event->button.x; + double port_y = event->button.y; + ganv_item_w2i(GANV_ITEM(port), &port_x, &port_y); + + if (module && port->impl->control && + (port->impl->is_input || + port_x < ganv_box_get_width(GANV_BOX(port)) / 2.0)) { if (port->impl->control->is_toggle) { if (port->impl->control->value >= 0.5) { ganv_port_set_control_value_internal(port, 0.0); |