summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-25 03:46:01 +0000
committerDavid Robillard <d@drobilla.net>2012-04-25 03:46:01 +0000
commite18aa5cf1c13ddc3bbcb8c007d85b8556baa7d85 (patch)
tree8fabd00769498ddf032ee3bab3d0657f0f4f80d0 /src
parent0cbdbc4219d353ace86219a0cfcbcfa62c1d3ac7 (diff)
downloadganv-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.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/node.c b/src/node.c
index 7c4b0d1..feba244 100644
--- a/src/node.c
+++ b/src/node.c
@@ -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);
}