Evas object text: Make the object size big enough to show the whole text.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 29 May 2012 14:43:21 +0000 (14:43 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 29 May 2012 14:43:21 +0000 (14:43 +0000)
I.e even if advance is smaller than width, take it into account.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@71507 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/canvas/evas_object_text.c

index c599296..530dc65 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2012-05-29  Tom Hacohen (TAsn)
 
+       * Text: Fixed an issue with text object sizing.
        * Font: Fixed run-time italic.
 
index 3b881c5..d976fcb 100644 (file)
@@ -238,7 +238,7 @@ static Evas_Coord
 _evas_object_text_horiz_advance_get(const Evas_Object *obj,
       const Evas_Object_Text *o)
 {
-   Evas_Object_Text_Item *it;
+   Evas_Object_Text_Item *it, *last_it = NULL;
    Evas_Coord adv;
    (void) obj;
 
@@ -246,7 +246,11 @@ _evas_object_text_horiz_advance_get(const Evas_Object *obj,
    EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
      {
         adv += it->adv;
+        last_it = it;
      }
+
+   if (last_it && (last_it->w > last_it->adv))
+      adv += last_it->w - last_it->adv;
    return adv;
 }