diff options
author | David Robillard <d@drobilla.net> | 2012-04-25 03:46:01 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-25 03:46:01 +0000 |
commit | e18aa5cf1c13ddc3bbcb8c007d85b8556baa7d85 (patch) | |
tree | 8fabd00769498ddf032ee3bab3d0657f0f4f80d0 /src | |
parent | 0cbdbc4219d353ace86219a0cfcbcfa62c1d3ac7 (diff) | |
download | ganv-e18aa5cf1c13ddc3bbcb8c007d85b8556baa7d85.tar.gz ganv-e18aa5cf1c13ddc3bbcb8c007d85b8556baa7d85.tar.bz2 ganv-e18aa5cf1c13ddc3bbcb8c007d85b8556baa7d85.zip |
Fix drag connection curves in vertical canvas.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4272 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/node.c | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -208,13 +208,24 @@ ganv_node_default_tail_vector(const GanvNode* self, double* dx, double* dy) { + GanvCanvas* canvas = GANV_CANVAS(GANV_ITEM(self)->canvas); + g_object_get(G_OBJECT(self), "x", x, "y", y, NULL); - *dx = 1.0; - *dy = 0.0; + switch (canvas->direction) { + case GANV_DIRECTION_RIGHT: + *dx = 1.0; + *dy = 0.0; + break; + case GANV_DIRECTION_DOWN: + *dx = 0.0; + *dy = 1.0; + break; + } + ganv_item_i2w(GANV_ITEM(self)->parent, x, y); } @@ -226,13 +237,24 @@ ganv_node_default_head_vector(const GanvNode* self, double* dx, double* dy) { + GanvCanvas* canvas = GANV_CANVAS(GANV_ITEM(self)->canvas); + g_object_get(G_OBJECT(self), "x", x, "y", y, NULL); - *dx = -1.0; - *dy = 0.0; + switch (canvas->direction) { + case GANV_DIRECTION_RIGHT: + *dx = -1.0; + *dy = 0.0; + break; + case GANV_DIRECTION_DOWN: + *dx = 0.0; + *dy = -1.0; + break; + } + ganv_item_i2w(GANV_ITEM(self)->parent, x, y); } |