From c92212ef31d045c9ded17979756c07a8cc174fbb Mon Sep 17 00:00:00 2001 From: tasn Date: Tue, 29 May 2012 14:43:21 +0000 Subject: [PATCH] Evas object text: Make the object size big enough to show the whole text. 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 | 1 + src/lib/canvas/evas_object_text.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c599296..530dc65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -768,5 +768,6 @@ 2012-05-29 Tom Hacohen (TAsn) + * Text: Fixed an issue with text object sizing. * Font: Fixed run-time italic. diff --git a/src/lib/canvas/evas_object_text.c b/src/lib/canvas/evas_object_text.c index 3b881c5..d976fcb 100644 --- a/src/lib/canvas/evas_object_text.c +++ b/src/lib/canvas/evas_object_text.c @@ -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; } -- 2.7.4