From: tasn Date: Tue, 16 Aug 2011 07:16:06 +0000 (+0000) Subject: Evas text: Set the object's size according to the advance, not width. X-Git-Tag: accepted/2.0/20130306.225542~242^2~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1bd38a1a06e3936db616bf79383bc681113cfcc4;p=profile%2Fivi%2Fevas.git Evas text: Set the object's size according to the advance, not width. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@62494 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_text.c b/src/lib/canvas/evas_object_text.c index cd0511d..e55fef2 100644 --- a/src/lib/canvas/evas_object_text.c +++ b/src/lib/canvas/evas_object_text.c @@ -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;