summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-02-07 13:05:06 +0000
committerTom Hacohen <tom@stosb.com>2014-02-07 13:14:21 +0000
commit354691e03e7810d64ec447a4ebdab1c1c602ef1b (patch)
tree74a85c819c8b93c2166e94d308af2a1da4868003
parent97f625c021fa3cbbeabe4164c1fb256430d54961 (diff)
Evas textblock: Fixed *_cursor_char_coord_set with some y values.
Specifically y values that are between par->y and the first ln->y. This should fix some selection issues with elm.
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 7868cccaa9..f62370d060 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -9743,17 +9743,22 @@ evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, E
9743 } 9743 }
9744 } 9744 }
9745 } 9745 }
9746 else if (o->paragraphs && (y >= o->paragraphs->y + o->formatted.h)) 9746
9747 { 9747 if (o->paragraphs)
9748 /* If we are after the last paragraph, use the last position in the
9749 * text. */
9750 evas_textblock_cursor_paragraph_last(cur);
9751 return EINA_TRUE;
9752 }
9753 else if (o->paragraphs && (y < o->paragraphs->y))
9754 { 9748 {
9755 evas_textblock_cursor_paragraph_first(cur); 9749 Evas_Object_Textblock_Line *first_line = o->paragraphs->lines;
9756 return EINA_TRUE; 9750 if (y >= o->paragraphs->y + o->formatted.h)
9751 {
9752 /* If we are after the last paragraph, use the last position in the
9753 * text. */
9754 evas_textblock_cursor_paragraph_last(cur);
9755 return EINA_TRUE;
9756 }
9757 else if (o->paragraphs && (y < (o->paragraphs->y + first_line->y)))
9758 {
9759 evas_textblock_cursor_paragraph_first(cur);
9760 return EINA_TRUE;
9761 }
9757 } 9762 }
9758 9763
9759 return EINA_FALSE; 9764 return EINA_FALSE;