summaryrefslogtreecommitdiffstats
path: root/src/canvas-base.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-03 01:08:49 +0000
committerDavid Robillard <d@drobilla.net>2014-01-03 01:08:49 +0000
commit9191aae81ab497d9cbf5a256b2b2e9dbf1af5d67 (patch)
tree2ea82730af0862baa33b921ea6bd6fe126b2d49e /src/canvas-base.c
parenta6aba9a3e541b8f193e93c653bac7bbae111de17 (diff)
downloadganv-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-base.c')
-rw-r--r--src/canvas-base.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/canvas-base.c b/src/canvas-base.c
index afd81b6..8d8b8d1 100644
--- a/src/canvas-base.c
+++ b/src/canvas-base.c
@@ -599,6 +599,26 @@ ganv_item_i2w_pair(GanvItem* item, double* x1, double* y1, double* x2, double* y
*y2 += off_y;
}
+/**
+ * ganv_item_w2i:
+ * @item: A canvas item.
+ * @x: X coordinate to convert (input/output value).
+ * @y: Y coordinate to convert (input/output value).
+ *
+ * Converts a coordinate pair from world coordinates to item-relative
+ * coordinates.
+ **/
+void
+ganv_item_w2i(GanvItem* item, double* x, double* y)
+{
+ double off_x;
+ double off_y;
+ ganv_item_i2w_offset(item, &off_x, &off_y);
+
+ *x -= off_x;
+ *y -= off_y;
+}
+
/* Returns whether the item is an inferior of or is equal to the parent. */
static gboolean
is_descendant(GanvItem* item, GanvItem* parent)