summaryrefslogtreecommitdiff
path: root/gfx/record.c
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/record.c')
-rw-r--r--gfx/record.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gfx/record.c b/gfx/record.c
index 5a17b6b..851d913 100644
--- a/gfx/record.c
+++ b/gfx/record.c
@@ -362,12 +362,11 @@ void record_replay(const struct record *rec, enum gfx_extra extra)
/* ----- Find text by position --------------------------------------------- */
-const char *record_find_text(const struct record *rec, enum gfx_extra extra,
- int x, int y)
+const char *record_find_text_bbox(const struct record *rec,
+ enum gfx_extra extra, int x, int y, struct record_bbox *bbox)
{
const struct record_layer *layer;
const struct record_obj *obj;
- struct record_bbox bbox;
for (layer = rec->layers; layer; layer = layer->next)
for (obj = layer->objs; obj; obj = obj->next) {
@@ -375,15 +374,24 @@ const char *record_find_text(const struct record *rec, enum gfx_extra extra,
continue;
if (obj->type != ro_text)
continue;
- bbox = obj->u.text.bbox;
- if (x >= bbox.xmin && x <= bbox.xmax &&
- y >= bbox.ymin && y <= bbox.ymax)
+ *bbox = obj->u.text.bbox;
+ if (x >= bbox->xmin && x <= bbox->xmax &&
+ y >= bbox->ymin && y <= bbox->ymax)
return obj->u.text.s;
}
return NULL;
}
+const char *record_find_text(const struct record *rec, enum gfx_extra extra,
+ int x, int y)
+{
+ struct record_bbox bbox;
+
+ return record_find_text_bbox(rec, extra, x, y, &bbox);
+}
+
+
/* ----- Bounding box ------------------------------------------------------ */