hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e08b942ffd640305c3ee489010d9fd0fb5ef7dd1

commit e08b942ffd640305c3ee489010d9fd0fb5ef7dd1
Author: ChunEon Park <chuneon.p...@samsung.com>
Date:   Thu May 7 20:02:01 2015 +0900

    evas vector: cancel the transformation when null is passed.
---
 src/lib/evas/canvas/efl_vg_base.eo |  5 ++++-
 src/lib/evas/canvas/evas_vg_node.c | 16 ++++++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/lib/evas/canvas/efl_vg_base.eo 
b/src/lib/evas/canvas/efl_vg_base.eo
index 52cf3c8..78c6974 100644
--- a/src/lib/evas/canvas/efl_vg_base.eo
+++ b/src/lib/evas/canvas/efl_vg_base.eo
@@ -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
+}
diff --git a/src/lib/evas/canvas/evas_vg_node.c 
b/src/lib/evas/canvas/evas_vg_node.c
index e3fb76e..2d84b86 100644
--- a/src/lib/evas/canvas/evas_vg_node.c
+++ b/src/lib/evas/canvas/evas_vg_node.c
@@ -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);
 }

-- 


Reply via email to