aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-10-09 11:51:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-30 01:49:59 +0800
commit6798b256cd3a74c5bbd76071d1073b628d740ca9 (patch)
tree2ab1763b870a3fcec30f324c8aaa417ed884ad54
parentebd534357ebcba5fef130d81b3f23c00c418a444 (diff)
downloadgsoc2013-evolution-6798b256cd3a74c5bbd76071d1073b628d740ca9.tar
gsoc2013-evolution-6798b256cd3a74c5bbd76071d1073b628d740ca9.tar.gz
gsoc2013-evolution-6798b256cd3a74c5bbd76071d1073b628d740ca9.tar.bz2
gsoc2013-evolution-6798b256cd3a74c5bbd76071d1073b628d740ca9.tar.lz
gsoc2013-evolution-6798b256cd3a74c5bbd76071d1073b628d740ca9.tar.xz
gsoc2013-evolution-6798b256cd3a74c5bbd76071d1073b628d740ca9.tar.zst
gsoc2013-evolution-6798b256cd3a74c5bbd76071d1073b628d740ca9.zip
gnome-canvas: Remove close_enough member
It's never set, so just replace it with its default value 0 everywhere.
-rw-r--r--libgnomecanvas/gnome-canvas.c13
-rw-r--r--libgnomecanvas/gnome-canvas.h3
-rw-r--r--widgets/text/e-reflow.c2
3 files changed, 4 insertions, 14 deletions
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index f89133c9ad..f79b37e75e 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 c698c833aa..bc11df3b62 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 cc1c64ebfa..3e062f0f93 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -1358,7 +1358,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;