edje_text.c: Fix text size bug when text size calc for fit option support. 63/67063/2
authorWoochan Lee <wc0917.lee@samsung.com>
Mon, 25 Apr 2016 03:49:36 +0000 (12:49 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Mon, 25 Apr 2016 03:51:30 +0000 (12:51 +0900)
Change-Id: Ia1ee631a00f7478958c87e67ce07a636f7e0149f

src/lib/edje/edje_text.c
src/lib/evas/canvas/evas_object_text.c
src/lib/evas/canvas/evas_text.eo

index a49b661..fdf574d 100644 (file)
@@ -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))
index d92042a..ef1ad7c 100644 (file)
@@ -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)
 {
index e26c561..de9cbd9 100644 (file)
@@ -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;