efl: fix efl_gfx_append_rect to clamp radius to always fit inside of the rectangle.
authorSubhransu Sekhar Mohanty <sub.mohanty@samsung.com>
Fri, 3 Apr 2015 14:33:59 +0000 (16:33 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 3 Apr 2015 14:33:59 +0000 (16:33 +0200)
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/efl/interfaces/efl_gfx_shape.c

index ef0c2a7..632c5bf 100644 (file)
@@ -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);