[evolution/rendering-cleanup: 19/78] gnome-canvas: Remove close_enough member



commit a75e3010c1b58c04ed5d1dedfc4272e5b6f9ff0f
Author: Benjamin Otte <otte redhat com>
Date:   Sat Oct 9 05:51:53 2010 +0200

    gnome-canvas: Remove close_enough member
    
    It's never set, so just replace it with its default value 0 everywhere.

 libgnomecanvas/gnome-canvas.c |   13 +++----------
 libgnomecanvas/gnome-canvas.h |    3 ---
 widgets/text/e-reflow.c       |    2 +-
 3 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index d2616bd..84eda87 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -1757,18 +1757,12 @@ gnome_canvas_group_point (GnomeCanvasItem *item,
 	GnomeCanvasGroup *group;
 	GList *list;
 	GnomeCanvasItem *child, *point_item;
-	gint x1, y1, x2, y2;
 	gdouble gx, gy;
 	gdouble dist, best;
 	gint has_point;
 
 	group = GNOME_CANVAS_GROUP (item);
 
-	x1 = cx - item->canvas->close_enough;
-	y1 = cy - item->canvas->close_enough;
-	x2 = cx + item->canvas->close_enough;
-	y2 = cy + item->canvas->close_enough;
-
 	best = 0.0;
 	*actual_item = NULL;
 
@@ -1780,7 +1774,7 @@ gnome_canvas_group_point (GnomeCanvasItem *item,
 	for (list = group->item_list; list; list = list->next) {
 		child = list->data;
 
-		if ((child->x1 > x2) || (child->y1 > y2) || (child->x2 < x1) || (child->y2 < y1))
+		if ((child->x1 > cx) || (child->y1 > cy) || (child->x2 < cx) || (child->y2 < cy))
 			continue;
 
 		point_item = NULL; /* cater for incomplete item implementations */
@@ -1794,8 +1788,7 @@ gnome_canvas_group_point (GnomeCanvasItem *item,
 
 		if (has_point
 		    && point_item
-		    && ((gint) (dist * item->canvas->pixels_per_unit + 0.5)
-			<= item->canvas->close_enough)) {
+		    && ((gint) (dist * item->canvas->pixels_per_unit + 0.5) <= 0)) {
 			best = dist;
 			*actual_item = point_item;
 		}
@@ -3586,7 +3579,7 @@ gnome_canvas_get_item_at (GnomeCanvas *canvas, gdouble x, gdouble y)
 	gnome_canvas_w2c (canvas, x, y, &cx, &cy);
 
 	dist = gnome_canvas_item_invoke_point (canvas->root, x, y, cx, cy, &item);
-	if ((gint) (dist * canvas->pixels_per_unit + 0.5) <= canvas->close_enough)
+	if ((gint) (dist * canvas->pixels_per_unit + 0.5) <= 0)
 		return item;
 	else
 		return NULL;
diff --git a/libgnomecanvas/gnome-canvas.h b/libgnomecanvas/gnome-canvas.h
index c698c83..bc11df3 100644
--- a/libgnomecanvas/gnome-canvas.h
+++ b/libgnomecanvas/gnome-canvas.h
@@ -417,9 +417,6 @@ struct _GnomeCanvas {
 	/* Event mask specified when grabbing an item */
 	guint grabbed_event_mask;
 
-	/* Tolerance distance for picking items */
-	gint close_enough;
-
 	/* Whether the canvas should center the scroll region in the middle of
 	 * the window if the scroll region is smaller than the window.
 	 */
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index d7522d6..5485b35 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -1352,7 +1352,7 @@ e_reflow_point (GnomeCanvasItem *item,
 
 	if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point)
 		distance = GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point (item, x, y, cx, cy, actual_item);
-	if ((gint) (distance * item->canvas->pixels_per_unit + 0.5) <= item->canvas->close_enough && *actual_item)
+	if ((gint) (distance * item->canvas->pixels_per_unit + 0.5) <= 0 && *actual_item)
 		return distance;
 
 	*actual_item = item;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]