evas vector: cancel the transformation when null is passed.
authorChunEon Park <chuneon.park@samsung.com>
Thu, 7 May 2015 11:02:01 +0000 (20:02 +0900)
committerChunEon Park <chuneon.park@samsung.com>
Fri, 8 May 2015 11:38:56 +0000 (20:38 +0900)
src/lib/evas/canvas/efl_vg_base.eo
src/lib/evas/canvas/evas_vg_node.c

index 52cf3c8..78c6974 100644 (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;
    }
-}
\ No newline at end of file
+}
index e3fb76e..2d84b86 100644 (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);
 }