evas: fix cursor_line_coord_set fail when y is 0.
authorYoungbok Shin <youngb.shin@samsung.com>
Tue, 16 Jan 2018 07:30:34 +0000 (16:30 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Tue, 16 Jan 2018 07:30:34 +0000 (16:30 +0900)
Signed-off-by: Vladyslav Shevchenko <v.shevchenko@samsung.com>
origin: spin (tizen_2.4 branch)

src/lib/evas/canvas/evas_object_textblock.c

index 4f91884..a0245d9 100644 (file)
@@ -13129,7 +13129,22 @@ evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y)
         _layout_paragraph_render(o, found_par);
         EINA_INLIST_FOREACH(found_par->lines, ln)
           {
+             /* TIZEN_ONLY(20150626): fix cursor_line_coord_set fail when y is 0.
              if (ln->par->y + ln->y > y) break;
+              */
+             if (ln->par->y + ln->y > y)
+               {
+                  if (ln->par->line_no + ln->line_no == 0)
+                    {
+                       evas_textblock_cursor_line_set(cur,
+                                                      ln->par->line_no + ln->line_no);
+
+                       return ln->par->line_no + ln->line_no;
+                     }
+                  break;
+               }
+             /* END */
+
              if ((ln->par->y + ln->y <= y) && ((ln->par->y + ln->y + ln->h) > y))
                {
                   evas_textblock_cursor_line_set(cur, ln->par->line_no +