Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/etox

Dir     : e17/libs/etox/src


Modified Files:
        etox.c etox_line.c 


Log Message:
Adjust lengths and widths of etox.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -3 -r1.92 -r1.93
--- etox.c      4 Oct 2004 17:32:19 -0000       1.92
+++ etox.c      5 Oct 2004 23:29:11 -0000       1.93
@@ -252,6 +252,8 @@
                et->length += start->length;
                et->lines = evas_list_append(et->lines, start);
                lines = evas_list_remove(lines, start);
+               if (start->w > et->tw)
+                       et->tw = start->w;
        }
 
        /*
@@ -341,6 +343,8 @@
                et->length += end->length;
                et->lines = evas_list_prepend(et->lines, end);
                lines = evas_list_remove(lines, end);
+               if (end->w > et->tw)
+                       et->tw = end->w;
        }
 
        /*
@@ -362,6 +366,7 @@
  */
 void etox_insert_text(Evas_Object * obj, char *text, int index)
 {
+       int len;
        Etox *et;
        Evas_Object *bit;
        Evas_List *lines = NULL, *ll;
@@ -409,7 +414,11 @@
         */
        temp = lines->data;
        lines = evas_list_remove(lines, temp);
+       len = start->length;
        etox_line_merge_append(start, temp);
+       et->length += start->length - len;
+       if (start->w > et->tw)
+               et->tw = start->w;
 
        /*
         * Now merge the end of the added text with the remainder of the
@@ -421,7 +430,11 @@
                lines = evas_list_remove(lines, temp);
                ll = evas_list_find_list(et->lines, start);
                end = ll->next->data;
+               len = temp->length;
                etox_line_merge_prepend(temp, end);
+               et->length += temp->length - len;
+               if (end->w > et->tw)
+                       et->tw = end->w;
        }
 
        /*
@@ -429,14 +442,12 @@
         */
        while (lines) {
                end = lines->data;
-
-               if (end->w > et->tw)
-                       et->tw = end->w;
-
                et->h += end->h;
                et->length += end->length;
                et->lines = evas_list_append_relative(et->lines, end, start);
                lines = evas_list_remove(lines, end);
+               if (end->w > et->tw)
+                       et->tw = end->w;
                start = end;
        }
 
@@ -1276,7 +1287,7 @@
 
        CHECK_PARAM_POINTER("et", et);
 
-       if (!et->flags & ETOX_SOFT_WRAP)
+       if (!(et->flags & ETOX_SOFT_WRAP))
                et->w = 0;
 
        if (!et->w)
@@ -1346,8 +1357,8 @@
                 * the width affects alignment.
                 */
                if ((et->flags & ETOX_SOFT_WRAP) && (line->w > et->w)) {
-                               etox_line_wrap(et, line);
-                               etox_line_layout(line);
+                       etox_line_wrap(et, line);
+                       etox_line_layout(line);
                }
 
                l = l->next;
@@ -1361,17 +1372,14 @@
        et->th = et->h;
        
 
-       if (et->flags & ETOX_SOFT_WRAP)
-       {
+       if (et->flags & ETOX_SOFT_WRAP) {
                evas_object_resize(et->clip, et->w, et->h);
                evas_object_resize(et->smart_obj, et->w, et->h);
        }
-       else
-       {
+       else {
                evas_object_resize(et->clip, et->tw, et->th);
                evas_object_resize(et->smart_obj, et->tw, et->th);
        }
-
 }
 
 Etox_Line *
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_line.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- etox_line.c 1 Oct 2004 19:42:33 -0000       1.41
+++ etox_line.c 5 Oct 2004 23:29:11 -0000       1.42
@@ -305,6 +305,7 @@
                bit = line2->bits->data;
                line1->bits = evas_list_append(line1->bits, bit);
                line2->bits = evas_list_remove(line2->bits, bit);
+               line1->length += etox_style_length(bit);
 
                etox_selections_update(bit, line1);
        }
@@ -314,7 +315,6 @@
        line1->w += line2->w;
        if (line2->h > line1->h)
                line1->h = line2->h;
-       line1->length += line2->length;
 }
 
 /*
@@ -338,6 +338,7 @@
                bit = line1->bits->data;
                line2->bits = evas_list_prepend(line2->bits, bit);
                line1->bits = evas_list_remove(line1->bits, bit);
+               line2->length += etox_style_length(bit);
        }
        /*
         * Adjust the height, width and length of the merged line.
@@ -345,7 +346,6 @@
        line2->w += line1->w;
        if (line1->h > line2->h)
                line2->h = line1->h;
-       line2->length += line1->length;
 }
 
 /*




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to