evas vector: cancel the transformation when null is passed.

This commit is contained in:
ChunEon Park 2015-05-07 20:02:01 +09:00
parent afd2c1c0be
commit e08b942ffd
2 changed files with 16 additions and 5 deletions

View File

@ -7,6 +7,9 @@ abstract Efl.VG.Base (Eo.Base, Efl.Gfx.Base, Efl.Gfx.Stack)
set {
/*@
Sets the transformation matrix to be used for this node object.
@note Pass @c NULL to cancel the applied transformation.
@since 1.14
*/
}
@ -90,4 +93,4 @@ abstract Efl.VG.Base (Eo.Base, Efl.Gfx.Base, Efl.Gfx.Stack)
Efl.Gfx.Stack.lower;
@virtual .bounds_get;
}
}
}

View File

@ -28,12 +28,20 @@ _efl_vg_base_transformation_set(Eo *obj,
Efl_VG_Base_Data *pd,
const Eina_Matrix3 *m)
{
if (!pd->m)
if (m)
{
pd->m = malloc(sizeof (Eina_Matrix3));
if (!pd->m) return ;
if (!pd->m)
{
pd->m = malloc(sizeof (Eina_Matrix3));
if (!pd->m) return;
}
memcpy(pd->m, m, sizeof (Eina_Matrix3));
}
else
{
free(pd->m);
pd->m = NULL;
}
memcpy(pd->m, m, sizeof (Eina_Matrix3));
_efl_vg_base_changed(obj);
}