summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2017-09-05 14:19:59 +0900
committerThiep Ha <thiepha@gmail.com>2017-09-05 14:19:59 +0900
commit6a8cf155a30426f140ee4a4988828a7fbf29e69f (patch)
tree90141e9d4523464eb150fab9faff2eb2429c55ce
parent54d1cc38a125e786311d103babd6dd366eea5656 (diff)
downloadefl-6a8cf155a30426f140ee4a4988828a7fbf29e69f.tar.gz
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.
-rw-r--r--src/bin/elementary/test_ui_textpath.c2
-rw-r--r--src/lib/elementary/efl_ui_textpath.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c
index 5860ff5a5c..88e8de4ee7 100644
--- a/src/bin/elementary/test_ui_textpath.c
+++ b/src/bin/elementary/test_ui_textpath.c
@@ -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 &lt;long&gt; 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);
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c
index 0ed45e8500..c5ff22a5e0 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -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;
}
}