Edje text: Fix a rare issue causing ellipsis not to work.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 12 Jun 2011 14:12:52 +0000 (14:12 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 12 Jun 2011 14:12:52 +0000 (14:12 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@60240 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/edje_text.c

index 9ec7856..671c09f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * Fix external usage in sub group to have the proper parents.
 
+2011-06-11  Tom Hacohen (TAsn)
+
+       * Fix an issue with ellipsis not working properly with small
+         text parts.
index c29cbe7..a2038d0 100644 (file)
@@ -148,9 +148,14 @@ _edje_text_fit_x(Edje *ed, Edje_Real_Part *ep,
           uc1 = evas_object_text_last_up_to_pos(ep->object,
                 -p + l, th / 2);
        if (params->type.text.elipsis != 1.0)
-          /* should be the last in text! not the rightmost */
-          uc2 = evas_object_text_last_up_to_pos(ep->object,
-                -p + sw - r, th / 2);
+          {
+             /* should be the last in text! not the rightmost */
+             if ((-p + sw -r) < 0)
+                uc2 = evas_object_text_last_up_to_pos(ep->object, 0, th / 2);
+             else
+                uc2 = evas_object_text_last_up_to_pos(ep->object,
+                      -p + sw - r, th / 2);
+          }
        if ((uc1 < 0) && (uc2 < 0))
          {
             uc1 = 0;