diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c index 7cf1c37ae5..2192f44709 100644 --- a/src/bin/elementary/test_ui_textpath.c +++ b/src/bin/elementary/test_ui_textpath.c @@ -15,13 +15,6 @@ static Evas_Object *angle_sld, *slice_sld, *dir_chk; static int path_type; -static void -_autofit_changed_cb(void *data, const Efl_Event *event) -{ - Evas_Object *txtpath = data; - efl_ui_textpath_autofit_set(txtpath, elm_check_state_get(event->object)); -} - static void _ellipsis_changed_cb(void *data, const Efl_Event *event) { @@ -112,7 +105,6 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve txtpath = efl_add(EFL_UI_TEXTPATH_CLASS, win); elm_box_pack_end(box, txtpath); - efl_ui_textpath_autofit_set(txtpath, EINA_TRUE); efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT); @@ -127,13 +119,6 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_gfx_entity_visible_set(hbox, EINA_TRUE); elm_box_pack_end(box, hbox); - chk = elm_check_add(win); - elm_object_text_set(chk, "Autofit"); - elm_check_state_set(chk, efl_ui_textpath_autofit_get(txtpath)); - efl_event_callback_add(chk, EFL_UI_CHECK_EVENT_CHANGED, _autofit_changed_cb, txtpath); - elm_box_pack_end(hbox, chk); - efl_gfx_entity_visible_set(chk, EINA_TRUE); - chk = elm_check_add(win); elm_object_text_set(chk, "Ellipsis"); elm_check_state_set(chk, efl_ui_textpath_ellipsis_get(txtpath)); diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index a378bdf7a9..e4315ed9de 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -63,7 +63,6 @@ struct _Efl_Ui_Textpath_Data } circle; Efl_Ui_Textpath_Direction direction; int slice_no; - Eina_Bool autofit; Eina_Bool ellipsis; Eina_Inlist *segments; @@ -329,10 +328,7 @@ _text_draw(Efl_Ui_Textpath_Data *pd) last_x1 = last_y1 = last_x2 = last_y2 = 0; sz = efl_gfx_entity_size_get(pd->text_obj); - if (pd->autofit) - remained_w = sz.w; - else - remained_w = pd->total_length; + remained_w = sz.w; map_point_no = _map_point_calc(pd); if (map_point_no == 0) @@ -353,8 +349,6 @@ _text_draw(Efl_Ui_Textpath_Data *pd) EINA_INLIST_FOREACH(pd->segments, seg) { int len = seg->length; - if (!pd->autofit) - len = (double)seg->length * sz.w / (double)pd->total_length; if (remained_w <= 0) break; w2 = w1 + len; @@ -372,10 +366,7 @@ _text_draw(Efl_Ui_Textpath_Data *pd) slice_value = pd->slice_no * seg->length / (double)pd->total_length; dt = (double)pd->total_length / (pd->slice_no * seg->length); - if (pd->autofit) - dist = (double)pd->total_length / (double)pd->slice_no; - else - dist = (double)pd->total_length * (w2 - w1) / ((double)pd->slice_no * seg->length); + dist = (double)pd->total_length / (double)pd->slice_no; slice_no = (int)ceil(slice_value); dt = (double)slice_value * dt / (double)slice_no; @@ -606,7 +597,6 @@ EOLIAN static Efl_Object * _efl_ui_textpath_efl_object_constructor(Eo *obj, Efl_Ui_Textpath_Data *pd) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - pd->autofit = EINA_TRUE; pd->slice_no = SLICE_DEFAULT_NO; pd->direction = EFL_UI_TEXTPATH_DIRECTION_CW; @@ -721,20 +711,6 @@ _efl_ui_textpath_circle_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double x, double _sizing_eval(pd); } -EOLIAN static Eina_Bool -_efl_ui_textpath_autofit_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd) -{ - return pd->autofit; -} - -EOLIAN static void -_efl_ui_textpath_autofit_set(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, Eina_Bool autofit) -{ - if (pd->autofit == autofit) return; - pd->autofit = autofit; - _sizing_eval(pd); -} - EOLIAN static int _efl_ui_textpath_slice_number_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd) { diff --git a/src/lib/elementary/efl_ui_textpath.eo b/src/lib/elementary/efl_ui_textpath.eo index 23acf586cc..23740856dd 100644 --- a/src/lib/elementary/efl_ui_textpath.eo +++ b/src/lib/elementary/efl_ui_textpath.eo @@ -18,15 +18,6 @@ class Efl.Ui.Textpath (Efl.Ui.Layout.Object, Efl.Object, Efl.Text, Efl.Gfx.Path) @in direction: Efl.Ui.Textpath_Direction; [[Textpath direction]] } } - @property autofit { - [[The ability to fit the text within the path. - Set it to $true to let text occupy only portion - same as its size. Otherwise, text will occupied the whole path. - By default, it is $true.]] - values { - autofit: bool; [[Autofit enabled if $true, $false otherwise]] - } - } @property slice_number { [[The number of slices. The larger the number of slice_num is, The better the text follows the path.]]