Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_text.c 


Log Message:
- make the cursor act a little better. if you arrow over to the righ thte
  cursor will actually appear to the extream right. multiline dosen't work
  correclty as I'm not taking the \n into account so the cursor ends up
  shifted one left (to the next line). mouse clicking on the end dosen't
  work right either, yet.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_text.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- ewl_text.c  30 Nov 2005 05:42:01 -0000      1.67
+++ ewl_text.c  1 Dec 2005 02:08:25 -0000       1.68
@@ -172,6 +172,7 @@
 {
        Evas_Coord tx = 0, ty = 0, tw = 0, th = 0;
        Evas_Textblock_Cursor *cursor;
+       int shifting = 0;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("t", t);
@@ -191,7 +192,11 @@
        /* force a display of the text */
        ewl_text_display(t);
 
-       if (idx >= t->length) idx = t->length - 1;
+       if (idx >= t->length)
+       {
+               idx = t->length - 1;
+               shifting = 1;
+       }
 
        cursor = ewl_text_textblock_cursor_position(t, idx);
        evas_textblock_cursor_char_geometry_get(cursor, &tx, &ty, &tw, &th);
@@ -202,6 +207,10 @@
        if (w) *w = (int)tw;
        if (h) *h = (int)th;
 
+       /* if we didn't count the last item, move us over to the other side
+        * of it */
+       if (shifting) *x += *w;
+
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
@@ -247,8 +256,7 @@
                        /* if so, get the line geometry and determine start
                         * or end of line */
                        evas_textblock_cursor_line_geometry_get(cursor, 
-                                                               &cx, &cy, 
-                                                               &cw, &ch);
+                                                       &cx, &cy, &cw, &ch);
                        if (x < (cx + (cw / 2)))
                                evas_textblock_cursor_line_first(cursor);
                        else




-------------------------------------------------------
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