summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2017-07-21 17:58:43 +0900
committerThiep Ha <thiepha@gmail.com>2017-07-21 17:58:43 +0900
commit1d47700c63a3661e4ef3d992b7fb708728832331 (patch)
tree107198152c72338dfc3e98efde56cc4ccd656961
parent0f31f5a855fcfa581afaaca58297334f3ff3ab43 (diff)
downloadefl-1d47700c63a3661e4ef3d992b7fb708728832331.tar.gz
fix map for line
-rw-r--r--src/bin/elementary/test_efl_ui_textpath.c9
-rw-r--r--src/lib/elementary/efl_ui_textpath.c11
2 files changed, 13 insertions, 7 deletions
diff --git a/src/bin/elementary/test_efl_ui_textpath.c b/src/bin/elementary/test_efl_ui_textpath.c
index 195adf98db..3e2f7ee5a4 100644
--- a/src/bin/elementary/test_efl_ui_textpath.c
+++ b/src/bin/elementary/test_efl_ui_textpath.c
@@ -24,17 +24,20 @@ elm_main(int argc, char *argv[])
txtpath = efl_add(EFL_UI_TEXTPATH_CLASS, win);
efl_ui_textpath_autofit_set(txtpath, EINA_TRUE);
- //efl_text_set(txtpath, "abcdef and more you can see from this test");
+
+ efl_text_set(txtpath, "abcdef and more you can see from this test");
//efl_text_set(txtpath, "abcd&lt;efghi&gt;jklm");
//efl_text_set(txtpath, "abcd&lt;eghi&gt;j");
//elm_object_text_set(txtpath, "abcd&lt;eghi&gt;j");
- efl_text_set(txtpath, "abcd&lt;eghi&gt;j more and more, so long to make it ellipsis? No, it is not enough, want to see more?xy");
+ //efl_text_set(txtpath, "abcd&lt;eghi&gt;j more and more, so long to make it ellipsis? No, it is not enough, want to see more?xy");
//efl_ui_textpath_circle_set(txtpath, 200, 200, 100, 0);
//efl_gfx_path_append_circle(txtpath, 200, 200, 100);
efl_gfx_path_append_arc(txtpath, 100, 100, 200, 200, 0, -90);
- efl_gfx_path_append_line_to(txtpath, 100, 200);
+ efl_gfx_path_append_line_to(txtpath, 300, 350);
+ //efl_gfx_path_append_move_to(txtpath, 200, 300);
+ //efl_gfx_path_append_line_to(txtpath, 300, 350);
//efl_gfx_path_append_move_to(txtpath, 100, 100);
//efl_gfx_path_append_line_to(txtpath, 200, 300);
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c
index ca5c065679..25eb880cd6 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -382,6 +382,7 @@ _text_on_line_draw(Efl_Ui_Textpath_Data *pd, int w1, int w2, int cmp, Evas_Map *
Evas_Coord x, y, w, h;
efl_gfx_geometry_get(pd->text_obj, &x, &y, &w, &h);
ERR("content geo: %d %d %d %d", x, y, w, h);
+ ERR("line geo: %.1f %.1f :: %.1f %.1f, area: %d %d, cmp: %d", x1, y1, x2, y2, w1, w2, cmp);
double len, sina, cosa;
len = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
@@ -398,9 +399,9 @@ _text_on_line_draw(Efl_Ui_Textpath_Data *pd, int w1, int w2, int cmp, Evas_Map *
h *= 2;
//w = len < w ? len : w;
evas_map_point_image_uv_set(map, cmp + 0, w1, 0);
- evas_map_point_image_uv_set(map, cmp + 1, w2 - w1, 0);
- evas_map_point_image_uv_set(map, cmp + 2, w2 - w1, h);
- evas_map_point_image_uv_set(map, cmp + 3, 0, h);
+ evas_map_point_image_uv_set(map, cmp + 1, w2, 0);
+ evas_map_point_image_uv_set(map, cmp + 2, w2, h);
+ evas_map_point_image_uv_set(map, cmp + 3, w1, h);
}
@@ -452,10 +453,11 @@ _text_draw(Eo *obj, Efl_Ui_Textpath_Data *pd)
if (map_no == 0) return;
map = evas_map_new(map_no);
+ w1 = w2 = 0;
EINA_INLIST_FOREACH(pd->segments, seg)
{
int len = seg->length;
- w1 = w - remained_w;
+ //w1 = w - remained_w;
w2 = w1 + len;
remained_w -= len;
if (seg->type == EFL_GFX_PATH_COMMAND_TYPE_LINE_TO)
@@ -475,6 +477,7 @@ _text_draw(Eo *obj, Efl_Ui_Textpath_Data *pd)
_segment_draw(pd, slice_no, slice_len, w1, w2, cur_map_point, map, EINA_FALSE, seg->bezier);
cur_map_point += slice_no * 4;
}
+ w1 = w2;
}
/*