diff options
author | Thiep Ha <thiepha@gmail.com> | 2017-09-05 11:55:07 +0900 |
---|---|---|
committer | Thiep Ha <thiepha@gmail.com> | 2017-09-05 11:55:07 +0900 |
commit | b55cb4feb1c35a0a6b31ac1ccbadc76432f581bc (patch) | |
tree | 5f96de6c9e9cd97a069cfdf445347ee0315548e0 | |
parent | b5e7a00681a5a86d2f31c2d1bb2b1697247d20b5 (diff) | |
download | efl-b55cb4feb1c35a0a6b31ac1ccbadc76432f581bc.tar.gz |
textpath: correct data gets from path
values of px0, py0 should be stored from previous command.
-rw-r--r-- | src/lib/elementary/efl_ui_textpath.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index eb82a45435..ec0a6a56c7 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -311,11 +311,10 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min) { int pos = -1; Eina_Rectangle *rect = eina_rectangle_new(0, 0, 0, 0); + double px0 = 0.0, py0 = 0.0, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1, px1, py1; while (*cmd != EFL_GFX_PATH_COMMAND_TYPE_END) { - double px0 = 0.0, py0 = 0.0, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1, px1, py1; - if (*cmd == EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO) { pos++; @@ -327,6 +326,7 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min) { Eina_Bezier bz; double bx, by, bw, bh; + Eina_Rectangle *brect; pos++; ctrl_x0 = points[pos] + x; @@ -361,12 +361,14 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min) py0 = py1; eina_bezier_bounds_get(&bz, &bx, &by, &bw, &bh); - Eina_Rectangle *brect = eina_rectangle_new(bx, by, bw, bh); + brect = eina_rectangle_new(bx, by, bw, bh); eina_rectangle_union(rect, brect); eina_rectangle_free(brect); } else if (*cmd == EFL_GFX_PATH_COMMAND_TYPE_LINE_TO) { + Eina_Rectangle *lrect; + pos++; px1 = points[pos] + x; pos++; @@ -388,7 +390,7 @@ _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min) pd->segments = eina_inlist_append(pd->segments, EINA_INLIST_GET(seg)); pd->total_length += seg->length; - Eina_Rectangle *lrect = eina_rectangle_new(px0, py0, px1 - px0, py1 - py0); + lrect = eina_rectangle_new(px0, py0, px1 - px0, py1 - py0); eina_rectangle_union(rect, lrect); eina_rectangle_free(lrect); } |