aboutsummaryrefslogtreecommitdiff
path: root/src/presentation.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-05-26 19:35:43 +0200
committerThomas White <taw@bitwiz.org.uk>2011-05-26 19:35:43 +0200
commit96605c925f243e88eeeb346dde95fb5a3066434f (patch)
treee23edbd19f8bca2a4f34f6d3dfd9fe4943cbed13 /src/presentation.c
parentbcbdceef6e1be59a6ca1d653b6a54bf9009b4143 (diff)
More clicky logic
Diffstat (limited to 'src/presentation.c')
-rw-r--r--src/presentation.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/presentation.c b/src/presentation.c
index 38b50fc..e02f103 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -110,6 +110,26 @@ void remove_object_from_slide(struct slide *s, struct object *o)
}
+struct object *find_object_at_position(struct slide *s, double x, double y)
+{
+ int i;
+ struct object *o = NULL;
+
+ for ( i=0; i<s->num_objects; i++ ) {
+
+ if ( (x>s->objects[i]->x) && (y>s->objects[i]->y)
+ && (x<s->objects[i]->x+s->objects[i]->bb_width)
+ && (y<s->objects[i]->y+s->objects[i]->bb_height) )
+ {
+ o = s->objects[i];
+ }
+
+ }
+
+ return o;
+}
+
+
struct presentation *new_presentation()
{
struct presentation *new;