changeset 70:92cfabe22d6b

find_shape_at_pos() finds a shape from clean ones.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 13 Aug 2008 09:12:09 +0800
parents a6150b4e0667
children 45c6ca5b3e80
files src/event.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/event.c	Wed Aug 13 08:21:06 2008 +0800
+++ b/src/event.c	Wed Aug 13 09:12:09 2008 +0800
@@ -84,7 +84,7 @@
     }
 }
 
-static geo_t *find_pos_in_geo(redraw_man_t *rdman,
+static geo_t *find_geo_in_pos(redraw_man_t *rdman,
 			      co_aix x, co_aix y, int *in_stroke) {
     geo_t *geo;
     geo_t **geos;
@@ -96,6 +96,8 @@
     cr = rdman->cr;
     for(i = rdman->n_gen_geos - 1; i >= 0; i--) {
 	geo = geos[i];
+	if(geo->flags & GEF_DIRTY)
+	    continue;
 	shape = geo->shape;
 	draw_shape_path(shape, cr);
 	if(shape->fill) {
@@ -127,7 +129,7 @@
     if(r != OK)
 	return NULL;
 
-    geo = find_pos_in_geo(rdman, x, y, in_stroke);
+    geo = find_geo_in_pos(rdman, x, y, in_stroke);
     if(geo == NULL)
 	return NULL;