From: Woochan Lee Date: Mon, 25 Apr 2016 03:49:36 +0000 (+0900) Subject: edje_text.c: Fix text size bug when text size calc for fit option support. X-Git-Tag: accepted/tizen/ivi/20160428.002924~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d13060258ee8cc78e66cdcf7e6d1b473b897f21e;p=platform%2Fupstream%2Fefl.git edje_text.c: Fix text size bug when text size calc for fit option support. Change-Id: Ia1ee631a00f7478958c87e67ce07a636f7e0149f --- diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c index a49b661..fdf574d 100644 --- a/src/lib/edje/edje_text.c +++ b/src/lib/edje/edje_text.c @@ -331,6 +331,13 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, efl_text_properties_font_set(font, size); efl_text_set(text)); + //TIZEN_ONLY(20160425): For fit option works well. the tw value should + // get a value that without ellipsis. + //part_get_geometry(ep, &tw, &th); + tw = evas_object_text_horiz_width_without_ellipsis_get(ep->object); + // + + /* Find the wanted font size */ part_get_geometry(ep, &tw, &th); /* Find the wanted font size */ if ((tw != sw) && (size > 0) && (tw != 0)) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index d92042a..ef1ad7c 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1161,6 +1161,20 @@ _evas_text_inset_get(Eo *eo_obj, Evas_Text_Data *o) return inset; } +// TIZEN_ONLY(20160425): Fix Evas Text truncated text case and evas_object_text_horiz_width_get() is added. +// horiz_advance_without_ellipsis is changed to horiz_width_without_ellipsis. +EOLIAN static Evas_Coord +_evas_text_horiz_width_without_ellipsis_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o) +{ + Evas_Coord horiz = 0; + if (!o->font) return horiz; + if (!o->items) return horiz; + horiz = _evas_object_text_horiz_width_without_ellipsis_get(o); + + return horiz; +} +// + EOLIAN static Evas_Coord _evas_text_horiz_advance_get(Eo *eo_obj EINA_UNUSED, Evas_Text_Data *o) { diff --git a/src/lib/evas/canvas/evas_text.eo b/src/lib/evas/canvas/evas_text.eo index e26c561..de9cbd9 100644 --- a/src/lib/evas/canvas/evas_text.eo +++ b/src/lib/evas/canvas/evas_text.eo @@ -192,6 +192,15 @@ class Evas.Text (Evas.Object, Efl.Text, Efl.Text_Properties, Evas.Filter) return: Evas.Coord; } } + @property horiz_width_without_ellipsis { + get { + [[ + // TIZEN_ONLY(20160425): Fix Evas Text truncated text case and evas_object_text_horiz_width_get() is add ed. + // horiz_advance_without_ellipsis is changed to horiz_width_without_ellipsis. + ]] + return: Evas.Coord; + } + } @property inset { get { return: Evas.Coord;