Evas textblock: Fixed char coord set to work better.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 2 Sep 2010 13:53:14 +0000 (13:53 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 2 Sep 2010 13:53:14 +0000 (13:53 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@51842 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 5c5a75a..b4e1004 100644 (file)
@@ -6748,9 +6748,17 @@ evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, E
             if (it_break)
               {
                  it = it_break;
+                 cur->node = it->source_node;
                  cur->pos = it->source_pos;
 
-                 cur->node = it->source_node;
+                  /*FIXME: needs smarter handling, ATM just check, if it's
+                   * the first item, then go to the end of the line, helps
+                   * with rtl langs, doesn't affect ltr langs that much. */
+                  if (!EINA_INLIST_GET(it)->prev)
+                    {
+                       evas_textblock_cursor_line_char_last(cur);
+                    }
+
                  return EINA_TRUE;
               }
          }