diff options
author | David Robillard <d@drobilla.net> | 2011-12-14 00:47:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-12-14 00:47:57 +0000 |
commit | 4b806a473d03faa24f00fad5e29721622236ed43 (patch) | |
tree | 2023a9ebaa82558b957a500c54b14165334730a4 /src/box.c | |
parent | 61cae4344c83e4439d6ed57f16082b0440f26581 (diff) | |
download | ganv-4b806a473d03faa24f00fad5e29721622236ed43.tar.gz ganv-4b806a473d03faa24f00fad5e29721622236ed43.tar.bz2 ganv-4b806a473d03faa24f00fad5e29721622236ed43.zip |
Custom module point and port draw handlers.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3872 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/box.c')
-rw-r--r-- | src/box.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -299,26 +299,19 @@ ganv_box_point(GanvItem* item, // Point is inside the box (distance 0) if ((x >= x1) && (y >= y1) && (x <= x2) && (y <= y2)) { - GanvItemClass* item_class = GANV_ITEM_CLASS(parent_class); - double d = item_class->point(item, x, y, cx, cy, actual_item); - if (*actual_item) { - return d; - } else { - *actual_item = item; - return 0.0; - } + *actual_item = item; + return 0.0; } // Point is outside the box - double dx, dy; + double dx = 0.0; + double dy = 0.0; // Find horizontal distance to nearest edge if (x < x1) { dx = x1 - x; } else if (x > x2) { dx = x - x2; - } else { - dx = 0.0; } // Find vertical distance to nearest edge @@ -326,8 +319,6 @@ ganv_box_point(GanvItem* item, dy = y1 - y; } else if (y > y2) { dy = y - y2; - } else { - dy = 0.0; } return sqrt((dx * dx) + (dy * dy)); |