aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/text')
-rw-r--r--widgets/text/e-reflow.c18
-rw-r--r--widgets/text/e-text.c14
2 files changed, 12 insertions, 20 deletions
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index 3e062f0f93..4974fd8f04 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -43,7 +43,7 @@ static void e_reflow_unrealize (GnomeCanvasItem *item);
static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
gint x, gint y, gint width, gint height);
static void e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gint flags);
-static gdouble e_reflow_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy, GnomeCanvasItem **actual_item);
+static GnomeCanvasItem *e_reflow_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy);
static void e_reflow_reflow (GnomeCanvasItem *item, gint flags);
static void set_empty (EReflow *reflow);
@@ -1347,22 +1347,16 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi
}
}
-static double
+static GnomeCanvasItem *
e_reflow_point (GnomeCanvasItem *item,
- gdouble x, gdouble y, gint cx, gint cy,
- GnomeCanvasItem **actual_item)
+ gdouble x, gdouble y, gint cx, gint cy)
{
- gdouble distance = 1;
-
- *actual_item = NULL;
+ GnomeCanvasItem *child;
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) <= 0 && *actual_item)
- return distance;
+ child = GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point (item, x, y, cx, cy);
- *actual_item = item;
- return 0;
+ return child ? child : item;
#if 0
if (y >= E_REFLOW_BORDER_WIDTH && y <= reflow->height - E_REFLOW_BORDER_WIDTH) {
gfloat n_x;
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 378a8dfc0e..e58d5bf8a2 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -1620,9 +1620,9 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
}
/* Point handler for the text item */
-static double
+static GnomeCanvasItem *
e_text_point (GnomeCanvasItem *item, gdouble x, gdouble y,
- gint cx, gint cy, GnomeCanvasItem **actual_item)
+ gint cx, gint cy)
{
EText *text;
gdouble clip_width;
@@ -1630,8 +1630,6 @@ e_text_point (GnomeCanvasItem *item, gdouble x, gdouble y,
text = E_TEXT (item);
- *actual_item = item;
-
/* The idea is to build bounding rectangles for each of the lines of
* text (clipped by the clipping rectangle, if it is activated) and see
* whether the point is inside any of these. If it is, we are done.
@@ -1656,17 +1654,17 @@ e_text_point (GnomeCanvasItem *item, gdouble x, gdouble y,
cx > text->clip_cx + clip_width ||
cy < text->clip_cy ||
cy > text->clip_cy + clip_height)
- return 1;
+ return NULL;
if (text->fill_clip_rectangle || !text->text || !*text->text)
- return 0;
+ return item;
cx -= text->cx;
if (pango_layout_xy_to_index (text->layout, cx, cy, NULL, NULL))
- return 0;
+ return item;
- return 1;
+ return NULL;
}
/* Bounds handler for the text item */