textpath: correct map point number

The last map point is not counted if seg is too small.
Test: change start angle to 3, the last segment is missed.
This commit is contained in:
Thiep Ha 2017-09-05 14:19:59 +09:00
parent 54d1cc38a1
commit 6a8cf155a3
2 changed files with 2 additions and 1 deletions

View File

@ -102,7 +102,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_text_set(txtpath, "This text follows the path which you defined. This is a <long> text designed to make it ellipsis.");
efl_ui_textpath_circle_set(txtpath, CX, CY, CR, 0, EFL_UI_TEXTPATH_DIRECTION_CCW);
efl_gfx_visible_set(txtpath, EINA_TRUE);
efl_gfx_visible_set(txtpath, EINA_TRUE);
path_type = 0;
hbox = elm_box_add(win);

View File

@ -213,6 +213,7 @@ _map_point_calc(Efl_Ui_Textpath_Data *pd)
else if (seg->type == EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO)
{
int no = pd->slice_no * seg->length / (double)pd->total_length;
if (no == 0) no = 1;
map_no += no;
}
}