Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/canvas Modified Files: evas_object_textblock.c Log Message: fix! textblokc word wrap and spec.in =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_textblock.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -3 -r1.49 -r1.50 --- evas_object_textblock.c 8 Mar 2005 03:33:09 -0000 1.49 +++ evas_object_textblock.c 11 Mar 2005 04:54:35 -0000 1.50 @@ -974,7 +974,8 @@ int pad_l = 0, pad_r = 0, pad_t = 0, pad_b = 0; int marginl = 0, marginr = 0; int ww, hh; - + int just_wrapped = 0; + o = (Evas_Object_Textblock *)(obj->object_data); ww = w; hh = h; @@ -1266,6 +1267,16 @@ text = strdup(node->text); new_node: + if (just_wrapped) + { + int pos, chr; + + pos = 0; + chr = evas_common_font_utf8_get_next(text, &pos); + if (evas_object_textblock_char_is_white(chr)) + strcpy(text, text + pos); + } + just_wrapped = 0; /* FIXME: we cant do this - we need to be able to qury text * overflow amounts */ /* @@ -1408,23 +1419,33 @@ } else { - chr = evas_common_font_utf8_get_next(text, &ppos); - if (ppos < 0) ppos = 0; - chrpos = ppos; - while ((evas_object_textblock_char_is_white(chr)) - && - (pos >= 0) && - (chr > 0)) + if (ppos == 0) + { + nchrpos = 0; + chrpos--; + } + else { - ppos = pos; - chr = evas_common_font_utf8_get_prev(text, &pos); + chr = evas_common_font_utf8_get_next(text, &ppos); + if (ppos < 0) ppos = 0; + chrpos = ppos; + while + ((evas_object_textblock_char_is_white(chr)) + && + (pos >= 0) && + (chr > 0)) + { + ppos = pos; + chr = evas_common_font_utf8_get_prev(text, &pos); + } + chr = evas_common_font_utf8_get_next(text, &ppos); + if (ppos < 0) ppos = 0; + nchrpos = ppos; } - chr = evas_common_font_utf8_get_next(text, &ppos); - if (ppos < 0) ppos = 0; - nchrpos = ppos; } } } + just_wrapped = 1; /* if the first char in the line can't fit!!! */ if ((chrpos == 0) && (lnode == line_start)) { ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs