Enlightenment CVS committal
Author : dj2
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/lib
Modified Files:
ewl_text.c
Log Message:
- if we click on the right half of the char move to the next index position
over
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_text.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_text.c 15 Aug 2005 21:55:08 -0000 1.15
+++ ewl_text.c 16 Aug 2005 15:57:45 -0000 1.16
@@ -16,10 +16,11 @@
*/
/* Make a static hash to look up the context's. They can be shared between
- * the differetn text blocks. Just need to ref count them so we know when
+ * the different text blocks. Just need to ref count them so we know when
* they can be destroyed
*/
static Ecore_Hash *context_hash = NULL;
+
static void ewl_text_context_cb_free(void *data);
static int ewl_text_context_compare(Ewl_Text_Context *a, Ewl_Text_Context *b);
static void ewl_text_context_print(Ewl_Text_Context *tx, char *indent);
@@ -244,6 +245,7 @@
int tb_idx, i = 0;
unsigned int idx = 0;
char *ptr;
+ Evas_Coord tcx, tcw;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR_RET("t", t, 0);
@@ -256,7 +258,7 @@
tb_idx = evas_object_textblock_char_coords_get(t->textblock,
(Evas_Coord)(x - CURRENT_X(t)),
(Evas_Coord)(y - CURRENT_Y(t)),
- NULL, NULL, NULL, NULL);
+ &tcx, NULL, &tcw, NULL);
/* if this is less then 0 then we clicked off of one end of the
* textblock or the other. if the click position is inside the size
@@ -278,6 +280,18 @@
DRETURN_INT(t->length, DLEVEL_STABLE);
}
}
+ else
+ {
+ Evas_Coord xpos;
+
+ xpos = (Evas_Coord)(x - CURRENT_X(t));
+
+ /* if we clicked on the right side of the char move us over
+ * to next index over */
+ if (xpos > (tcx + (tcw / 2)))
+ tb_idx ++;
+ }
+
idx = tb_idx;
/* need to add \n \r \t stuff back into the count */
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs