hermet pushed a commit to branch master.

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

commit fd4f4c43647c4971a94f1eff2266be7df47a9f66
Author: JunsuChoi <jsuya.c...@samsung.com>
Date:   Thu Jun 25 13:13:31 2020 +0900

    Revert "Efl.Gfx.Path: Change draw of a rounded rect from arc to quadratic"
    
    Summary:
    This reverts commit 4f15bde706ec8cd78fa57845c8eee7bdb5515282.
    It is the correct way to draw with arc_to.
    And breaking compatibility for current_get.
    
    Test Plan: N/A
    
    Reviewers: Hermet, kimcinoo, herb
    
    Reviewed By: Hermet
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D12030
---
 src/lib/efl/interfaces/efl_gfx_path.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_gfx_path.c 
b/src/lib/efl/interfaces/efl_gfx_path.c
index 8a02f1f79b..5f2898f06e 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.c
+++ b/src/lib/efl/interfaces/efl_gfx_path.c
@@ -1108,18 +1108,16 @@ _efl_gfx_path_append_rect(Eo *obj, Efl_Gfx_Path_Data 
*pd,
      }
 
    // clamp the rx and ry radius value.
+   rx = 2*rx;
+   ry = 2*ry;
    if (rx > w) rx = w;
    if (ry > h) ry = h;
 
-   _efl_gfx_path_append_move_to(obj, pd, x + rx, y);
-   _efl_gfx_path_append_line_to(obj, pd, x + (w - rx), y);
-   _efl_gfx_path_append_quadratic_to(obj, pd, x + w, y + ry, x + w, y);
-   _efl_gfx_path_append_line_to(obj, pd, x + w, y + (h - ry));
-   _efl_gfx_path_append_quadratic_to(obj, pd, x + (w - rx), y + h, x + w, y + 
h);
-   _efl_gfx_path_append_line_to(obj, pd, x + rx, y + h);
-   _efl_gfx_path_append_quadratic_to(obj, pd, x , y + (h - ry), x, y + h);
-   _efl_gfx_path_append_line_to(obj, pd, x, y + ry);
-   _efl_gfx_path_append_quadratic_to(obj, pd, x + rx, y, x, y);
+   _efl_gfx_path_append_move_to(obj, pd, x, y + h/2);
+   _efl_gfx_path_append_arc(obj, pd, x, y + h - ry, rx, ry, 180, 90);
+   _efl_gfx_path_append_arc(obj, pd, x + w - rx, y + h - ry, rx, ry, 270, 90);
+   _efl_gfx_path_append_arc(obj, pd, x + w - rx, y, rx, ry, 0, 90);
+   _efl_gfx_path_append_arc(obj, pd, x, y, rx, ry, 90, 90);
    _efl_gfx_path_append_close(obj, pd);
 
    //update convex flag

-- 


Reply via email to