efl: fix efl_gfx_append_rect to clamp radius to always fit inside of the rectangle.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Subhransu Sekhar Mohanty 2015-04-03 16:33:59 +02:00 committed by Cedric BAIL
parent c1c6b7effc
commit b1e663b368
1 changed files with 4 additions and 0 deletions

View 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);