Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_entry.c ewl_text.c 


Log Message:
- if you click on the end of a line in a multiline text it will put the
  cursor in the correct place. still something wrong with the first line.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- ewl_entry.c 1 Dec 2005 01:42:22 -0000       1.40
+++ ewl_entry.c 1 Dec 2005 05:35:04 -0000       1.41
@@ -358,7 +358,6 @@
 
        idx = ewl_text_coord_index_map(EWL_TEXT(e), event->x, event->y);
        ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor), idx);
-
        ewl_widget_configure(w);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_text.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -3 -r1.68 -r1.69
--- ewl_text.c  1 Dec 2005 02:08:25 -0000       1.68
+++ ewl_text.c  1 Dec 2005 05:35:04 -0000       1.69
@@ -2268,6 +2268,7 @@
 {
        Evas_Textblock_Cursor *cursor;
        int cur_idx;
+       const char *txt;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET("t", t, NULL);
@@ -2277,10 +2278,14 @@
        evas_textblock_cursor_node_first(cursor);
 
        cur_idx = idx;
-       while (cur_idx >= 0)
+
+       /* if we get to a point where the current index is zero then we need
+        * to walk past any formatting nodes before we are where we want to
+        * be. (Without the txt then triggers break, with >= 0 the mouse
+        * placement of the cursor in the entry breaks */
+       while ((cur_idx > 0) || txt)
        {
                int len = 0;
-               const char *txt;
 
                /* see if this is a formatting or text node */
                txt = evas_textblock_cursor_node_format_get(cursor);
@@ -2324,8 +2329,7 @@
        {
                const char *txt;
                txt = evas_textblock_cursor_node_format_get(cursor);
-               if (!txt)
-                       idx += 
evas_textblock_cursor_node_text_length_get(cursor);
+               if (!txt) idx += 
evas_textblock_cursor_node_text_length_get(cursor);
                else if (!strcmp(txt, "\n")) idx ++;
                else if (!strcmp(txt, "\t")) idx ++;
        }




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to