Evas text: Set the object's size according to the advance, not width.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 16 Aug 2011 07:16:06 +0000 (07:16 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 16 Aug 2011 07:16:06 +0000 (07:16 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@62494 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_text.c

index cd0511d..e55fef2 100644 (file)
@@ -257,37 +257,6 @@ _evas_object_text_vert_advance_get(const Evas_Object *obj __UNUSED__,
    return o->max_ascent + o->max_descent;
 }
 
-/* FIXME: returns the advance instead of the width just because it's usuallly
- * bigger, major hack, should fix. */
-static void
-_evas_object_text_string_size_get(const Evas_Object *obj,
-      const Evas_Object_Text *o,
-      Evas_Coord *cw, Evas_Coord *ch)
-{
-   Evas_Object_Text_Item *it, *last_it = NULL;
-   Evas_Coord w, h;
-   (void) obj;
-
-   w = h = 0;
-   EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
-     {
-        w += it->adv;
-        if (it->h > h)
-          {
-             h = it->h;
-          }
-        last_it = it;
-     }
-   /* Take the width, not the advance of the last item */
-   if (last_it)
-     {
-        w += last_it->w - last_it->adv;
-     }
-
-   if (cw) *cw = w;
-   if (ch) *ch = h;
-}
-
 EAPI Evas_Object *
 evas_object_text_add(Evas *e)
 {
@@ -1952,7 +1921,8 @@ _evas_object_text_recalc(Evas_Object *obj)
        int w, h;
        int l = 0, r = 0, t = 0, b = 0;
 
-        _evas_object_text_string_size_get(obj, o, &w, &h);
+        w = _evas_object_text_horiz_advance_get(obj, o);
+        h = _evas_object_text_vert_advance_get(obj, o);
        evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
        obj->cur.geometry.w = w + l + r;
         obj->cur.geometry.h = h + t + b;