thiep pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b55cb4feb1c35a0a6b31ac1ccbadc76432f581bc

commit b55cb4feb1c35a0a6b31ac1ccbadc76432f581bc
Author: Thiep Ha <thie...@gmail.com>
Date:   Tue Sep 5 11:55:07 2017 +0900

    textpath: correct data gets from path
    
    values of px0, py0 should be stored from previous command.
---
 src/lib/elementary/efl_ui_textpath.c | 10 ++++++----
 1 file 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);
                }

-- 


Reply via email to