From eefcc08f9f09f68f88cadab3ddaae84c22e78f1f Mon Sep 17 00:00:00 2001 From: tasn Date: Mon, 14 Feb 2011 16:14:26 +0000 Subject: [PATCH] Evas textblock: Fixed evas_textblock_cursor_range_geometry_get which didn't work when across multiple paragraphs. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@57027 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 15a5f39..e8e1e52 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -7953,7 +7953,7 @@ evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, cons } else { - Evas_Object_Textblock_Line *lni; + Evas_Object_Textblock_Line *plni, *lni; Eina_List *rects2 = NULL; /* Handle the first line */ rects = _evas_textblock_cursor_range_in_line_geometry_get(ln1, @@ -7961,15 +7961,26 @@ evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, cons /* Handle the lines between the first and the last line */ lni = (Evas_Object_Textblock_Line *) EINA_INLIST_GET(ln1)->next; + if (!lni && (ln1->par != ln2->par)) + { + lni = ((Evas_Object_Textblock_Paragraph *) + EINA_INLIST_GET(ln1->par)->next)->lines; + } while (lni && (lni != ln2)) { tr = calloc(1, sizeof(Evas_Textblock_Rectangle)); rects = eina_list_append(rects, tr); - tr->x = lni->x; - tr->y = lni->y; + tr->x = lni->par->x + lni->x; + tr->y = lni->par->y + lni->y; tr->h = lni->h; tr->w = lni->w; + plni = lni; lni = (Evas_Object_Textblock_Line *) EINA_INLIST_GET(lni)->next; + if (!lni && (plni->par != ln2->par)) + { + lni = ((Evas_Object_Textblock_Paragraph *) + EINA_INLIST_GET(plni->par)->next)->lines; + } } rects2 = _evas_textblock_cursor_range_in_line_geometry_get(ln2, NULL, cur2); -- 2.7.4