From b1e663b3688c1288236c39ec047487eb634c455a Mon Sep 17 00:00:00 2001 From: Subhransu Sekhar Mohanty Date: Fri, 3 Apr 2015 16:33:59 +0200 Subject: [PATCH] efl: fix efl_gfx_append_rect to clamp radius to always fit inside of the rectangle. Signed-off-by: Cedric BAIL --- src/lib/efl/interfaces/efl_gfx_shape.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c index ef0c2a7ac9..632c5bf979 100644 --- a/src/lib/efl/interfaces/efl_gfx_shape.c +++ b/src/lib/efl/interfaces/efl_gfx_shape.c @@ -802,6 +802,10 @@ _efl_gfx_shape_append_rect(Eo *obj, Efl_Gfx_Shape_Data *pd, double x, double y, double w, double h, double rx, double ry) { + // clamp the x and y radius value. + if (rx > w/2) rx = w/2; + if (ry > h/2) ry = h/2; + _efl_gfx_shape_append_move_to(obj, pd, x, y + ry); // Top left corner _efl_gfx_shape_append_arc_to(obj, pd, x + rx, y, rx, ry, 0, EINA_FALSE, EINA_TRUE);