summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-06-08 16:07:42 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-06-30 17:28:35 +0900
commitce78500ba2be841dd17e5d715082c65cba520217 (patch)
tree3e9ce571c31b2764aabe64f06a9b7940c9a604e1
parent3ec9699a2976bbb0cecd73b0d5d8307309e61428 (diff)
downloadefl-ce78500ba2be841dd17e5d715082c65cba520217.tar.gz
efl_animation: Code refactorying rotate animation
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_rotate.c183
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_rotate.eo29
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.c227
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.eo29
4 files changed, 306 insertions, 162 deletions
diff --git a/src/lib/evas/canvas/efl_animation_instance_rotate.c b/src/lib/evas/canvas/efl_animation_instance_rotate.c
index 4d2e5cb5d2..20d2825fa5 100644
--- a/src/lib/evas/canvas/efl_animation_instance_rotate.c
+++ b/src/lib/evas/canvas/efl_animation_instance_rotate.c
@@ -23,103 +23,181 @@
typedef struct _Evas_Object_Animation_Instance_Rotate_Property
{
- double angle;
+ double degree;
} Evas_Object_Animation_Instance_Rotate_Property;
typedef struct _Evas_Object_Animation_Instance_Rotate_Absolute_Pivot
{
- Evas_Coord x, y, z;
+ Evas_Coord cx, cy;
} Evas_Object_Animation_Instance_Rotate_Absolute_Pivot;
typedef struct _Evas_Object_Animation_Instance_Rotate_Relative_Pivot
{
- double x, y, z;
+ Efl_Canvas_Object *obj;
+ double cx, cy;
} Evas_Object_Animation_Instance_Rotate_Relative_Pivot;
-
struct _Evas_Object_Animation_Instance_Rotate_Data
{
Evas_Object_Animation_Instance_Rotate_Property from;
Evas_Object_Animation_Instance_Rotate_Property to;
+
Evas_Object_Animation_Instance_Rotate_Absolute_Pivot abs_pivot;
Evas_Object_Animation_Instance_Rotate_Relative_Pivot rel_pivot;
+
Eina_Bool use_rel_pivot;
};
EOLIAN static void
-_efl_animation_instance_rotate_angle_set(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double from_angle, double to_angle)
+_efl_animation_instance_rotate_rotate_set(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double from_degree, double to_degree, Efl_Canvas_Object *pivot, double cx, double cy)
{
EFL_ANIMATION_INSTANCE_ROTATE_CHECK_OR_RETURN(eo_obj);
- pd->from.angle = from_angle;
+ pd->from.degree = from_degree;
+ pd->to.degree = to_degree;
- pd->to.angle = to_angle;
-}
+ pd->rel_pivot.obj = pivot;
+ pd->rel_pivot.cx = cx;
+ pd->rel_pivot.cy = cy;
-EOLIAN static void
-_efl_animation_instance_rotate_angle_get(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double *from_angle, double *to_angle)
-{
- EFL_ANIMATION_INSTANCE_ROTATE_CHECK_OR_RETURN(eo_obj);
+ //Update absolute pivot based on relative pivot
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
- if (from_angle)
- *from_angle = pd->from.angle;
+ if (pivot)
+ evas_object_geometry_get(pivot, &x, &y, &w, &h);
+ else
+ {
+ Eo *target = efl_animation_instance_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
+ }
- if (to_angle)
- *to_angle = pd->to.angle;
+ pd->abs_pivot.cx = x + (w * cx);
+ pd->abs_pivot.cy = y + (h * cy);
+
+ pd->use_rel_pivot = EINA_TRUE;
}
EOLIAN static void
-_efl_animation_instance_rotate_relative_pivot_set(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double pivot_x, double pivot_y, double pivot_z)
+_efl_animation_instance_rotate_rotate_get(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double *from_degree, double *to_degree, Efl_Canvas_Object **pivot, double *cx, double *cy)
{
EFL_ANIMATION_INSTANCE_ROTATE_CHECK_OR_RETURN(eo_obj);
- pd->rel_pivot.x = pivot_x;
- pd->rel_pivot.y = pivot_y;
- pd->rel_pivot.z = pivot_z;
+ //Update relative pivot based on absolute pivot
+ if (!pd->use_rel_pivot)
+ {
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
- pd->use_rel_pivot = EINA_TRUE;
-}
+ Eo *target = efl_animation_instance_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
-EOLIAN static void
-_efl_animation_instance_rotate_relative_pivot_get(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double *pivot_x, double *pivot_y, double *pivot_z)
-{
- EFL_ANIMATION_INSTANCE_ROTATE_CHECK_OR_RETURN(eo_obj);
+ if (w != 0)
+ pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
+ else
+ pd->rel_pivot.cx = 0.0;
+
+ if (h != 0)
+ pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
+ else
+ pd->rel_pivot.cy = 0.0;
+ }
+
+ if (from_degree)
+ *from_degree = pd->from.degree;
- if (pivot_x)
- *pivot_x = pd->rel_pivot.x;
+ if (to_degree)
+ *to_degree = pd->to.degree;
- if (pivot_y)
- *pivot_y = pd->rel_pivot.y;
+ if (pivot)
+ *pivot = pd->rel_pivot.obj;
- if (pivot_z)
- *pivot_z = pd->rel_pivot.z;
+ if (cx)
+ *cx = pd->rel_pivot.cx;
+
+ if (cy)
+ *cy = pd->rel_pivot.cy;
}
EOLIAN static void
-_efl_animation_instance_rotate_absolute_pivot_set(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, Evas_Coord pivot_x, Evas_Coord pivot_y, Evas_Coord pivot_z)
+_efl_animation_instance_rotate_rotate_absolute_set(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double from_degree, double to_degree, Evas_Coord cx, Evas_Coord cy)
{
EFL_ANIMATION_INSTANCE_ROTATE_CHECK_OR_RETURN(eo_obj);
- pd->abs_pivot.x = pivot_x;
- pd->abs_pivot.y = pivot_y;
- pd->abs_pivot.z = pivot_z;
+ pd->from.degree = from_degree;
+ pd->to.degree = to_degree;
+
+ pd->abs_pivot.cx = cx;
+ pd->abs_pivot.cy = cy;
+
+ //Update relative pivot based on absolute pivot
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
+
+ Eo *target = efl_animation_instance_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
+
+ pd->rel_pivot.obj = NULL;
+
+ if (w != 0)
+ pd->rel_pivot.cx = (double)(cx - x) / w;
+ else
+ pd->rel_pivot.cx = 0.0;
+
+ if (h != 0)
+ pd->rel_pivot.cy = (double)(cy - y) / h;
+ else
+ pd->rel_pivot.cy = 0.0;
pd->use_rel_pivot = EINA_FALSE;
}
EOLIAN static void
-_efl_animation_instance_rotate_absolute_pivot_get(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, Evas_Coord *pivot_x, Evas_Coord *pivot_y, Evas_Coord *pivot_z)
+_efl_animation_instance_rotate_rotate_absolute_get(Eo *eo_obj, Evas_Object_Animation_Instance_Rotate_Data *pd, double *from_degree, double *to_degree, Evas_Coord *cx, Evas_Coord *cy)
{
EFL_ANIMATION_INSTANCE_ROTATE_CHECK_OR_RETURN(eo_obj);
- if (pivot_x)
- *pivot_x = pd->abs_pivot.x;
-
- if (pivot_y)
- *pivot_y = pd->abs_pivot.y;
-
- if (pivot_z)
- *pivot_z = pd->abs_pivot.z;
+ //Update absolute pivot based on relative pivot
+ if (pd->use_rel_pivot)
+ {
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
+
+ if (pd->rel_pivot.obj)
+ evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
+ else
+ {
+ Eo *target = efl_animation_instance_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
+ }
+
+ pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
+ pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
+ }
+
+ if (from_degree)
+ *from_degree = pd->from.degree;
+
+ if (to_degree)
+ *to_degree = pd->to.degree;
+
+ if (cx)
+ *cx = pd->abs_pivot.cx;
+
+ if (cy)
+ *cy = pd->abs_pivot.cy;
}
static void
@@ -133,16 +211,15 @@ _efl_animation_instance_rotate_efl_object_constructor(Eo *eo_obj, Evas_Object_An
{
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
- pd->from.angle = 0.0;
- pd->to.angle = 0.0;
+ pd->from.degree = 0.0;
+ pd->to.degree = 0.0;
- pd->rel_pivot.x = 0.5;
- pd->rel_pivot.y = 0.5;
- pd->rel_pivot.z = 0.5;
+ pd->rel_pivot.obj = NULL;
+ pd->rel_pivot.cx = 0.5;
+ pd->rel_pivot.cy = 0.5;
- pd->abs_pivot.x = 0;
- pd->abs_pivot.y = 0;
- pd->abs_pivot.z = 0;
+ pd->abs_pivot.cx = 0;
+ pd->abs_pivot.cy = 0;
pd->use_rel_pivot = EINA_TRUE;
diff --git a/src/lib/evas/canvas/efl_animation_instance_rotate.eo b/src/lib/evas/canvas/efl_animation_instance_rotate.eo
index bf7345d132..bd8d252ccf 100644
--- a/src/lib/evas/canvas/efl_animation_instance_rotate.eo
+++ b/src/lib/evas/canvas/efl_animation_instance_rotate.eo
@@ -6,36 +6,29 @@ class Efl.Animation.Instance.Rotate (Efl.Animation.Instance)
legacy_prefix: evas_object_animation_instance;
data: Evas_Object_Animation_Instance_Rotate_Data;
methods {
- @property angle @protected /* @internal */ {
+ @property rotate @protected /* @internal */ {
set {
}
get {
}
values {
- from_angle: double; [[Rotation angle when animation starts]]
- to_angle: double; [[Rotation angle when animation ends]]
+ from_degree: double; [[Rotation degree when animation starts]]
+ to_degree: double; [[Rotation degree when animation ends]]
+ pivot: Efl.Canvas.Object; [[Pivot object for the center point. If the pivot object is NULL, then the object is rotated on itself.]]
+ cx: double; [[X relative coordinate of the center point. The left end is 0.0 and the right end is 1.0 (the center is 0.5).]]
+ cy: double; [[Y relative coordinate of the center point. The top end is 0.0 and the bottom end is 1.0 (the center is 0.5).]]
}
}
- @property relative_pivot @protected /* @internal */ {
+ @property rotate_absolute @protected /* @internal */ {
set {
}
get {
}
values {
- x: double; [[Relative pivot value along x axis. The left is 0.0 and the right is 1.0.]]
- y: double; [[Relative pivot value along x axis. The top is 0.0 and the bottom is 1.0.]]
- z: double; [[Relative pivot value along x axis. The front is 0.0 and the rear is 1.0.]]
- }
- }
- @property absolute_pivot @protected /* @internal */ {
- set {
- }
- get {
- }
- values {
- x: int; [[Absolute pivot value along x axis]]
- y: int; [[Absolute pivot value along x axis]]
- z: int; [[Absolute pivot value along x axis]]
+ from_degree: double; [[Rotation degree when animation starts]]
+ to_degree: double; [[Rotation degree when animation ends]]
+ cx: int; [[X absolute coordinate of the center point.]]
+ cy: int; [[Y absolute coordinate of the center point.]]
}
}
}
diff --git a/src/lib/evas/canvas/efl_animation_rotate.c b/src/lib/evas/canvas/efl_animation_rotate.c
index c9ffe524bd..bc58fdf695 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.c
+++ b/src/lib/evas/canvas/efl_animation_rotate.c
@@ -23,103 +23,181 @@
typedef struct _Evas_Object_Animation_Rotate_Property
{
- double angle;
+ double degree;
} Evas_Object_Animation_Rotate_Property;
typedef struct _Evas_Object_Animation_Rotate_Absolute_Pivot
{
- Evas_Coord x, y, z;
+ Evas_Coord cx, cy;
} Evas_Object_Animation_Rotate_Absolute_Pivot;
typedef struct _Evas_Object_Animation_Rotate_Relative_Pivot
{
- double x, y, z;
+ Efl_Canvas_Object *obj;
+ double cx, cy;
} Evas_Object_Animation_Rotate_Relative_Pivot;
-
struct _Evas_Object_Animation_Rotate_Data
{
Evas_Object_Animation_Rotate_Property from;
Evas_Object_Animation_Rotate_Property to;
+
Evas_Object_Animation_Rotate_Absolute_Pivot abs_pivot;
Evas_Object_Animation_Rotate_Relative_Pivot rel_pivot;
+
Eina_Bool use_rel_pivot;
};
EOLIAN static void
-_efl_animation_rotate_angle_set(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double from_angle, double to_angle)
+_efl_animation_rotate_rotate_set(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double from_degree, double to_degree, Efl_Canvas_Object *pivot, double cx, double cy)
{
EFL_ANIMATION_ROTATE_CHECK_OR_RETURN(eo_obj);
- pd->from.angle = from_angle;
+ pd->from.degree = from_degree;
+ pd->to.degree = to_degree;
- pd->to.angle = to_angle;
-}
+ pd->rel_pivot.obj = pivot;
+ pd->rel_pivot.cx = cx;
+ pd->rel_pivot.cy = cy;
-EOLIAN static void
-_efl_animation_rotate_angle_get(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double *from_angle, double *to_angle)
-{
- EFL_ANIMATION_ROTATE_CHECK_OR_RETURN(eo_obj);
+ //Update absolute pivot based on relative pivot
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
- if (from_angle)
- *from_angle = pd->from.angle;
+ if (pivot)
+ evas_object_geometry_get(pivot, &x, &y, &w, &h);
+ else
+ {
+ Eo *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
+ }
- if (to_angle)
- *to_angle = pd->to.angle;
+ pd->abs_pivot.cx = x + (w * cx);
+ pd->abs_pivot.cy = y + (h * cy);
+
+ pd->use_rel_pivot = EINA_TRUE;
}
EOLIAN static void
-_efl_animation_rotate_relative_pivot_set(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double pivot_x, double pivot_y, double pivot_z)
+_efl_animation_rotate_rotate_get(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double *from_degree, double *to_degree, Efl_Canvas_Object **pivot, double *cx, double *cy)
{
EFL_ANIMATION_ROTATE_CHECK_OR_RETURN(eo_obj);
- pd->rel_pivot.x = pivot_x;
- pd->rel_pivot.y = pivot_y;
- pd->rel_pivot.z = pivot_z;
+ //Update relative pivot based on absolute pivot
+ if (!pd->use_rel_pivot)
+ {
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
- pd->use_rel_pivot = EINA_TRUE;
-}
+ Eo *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
-EOLIAN static void
-_efl_animation_rotate_relative_pivot_get(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double *pivot_x, double *pivot_y, double *pivot_z)
-{
- EFL_ANIMATION_ROTATE_CHECK_OR_RETURN(eo_obj);
+ if (w != 0)
+ pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
+ else
+ pd->rel_pivot.cx = 0.0;
- if (pivot_x)
- *pivot_x = pd->rel_pivot.x;
+ if (h != 0)
+ pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
+ else
+ pd->rel_pivot.cy = 0.0;
+ }
- if (pivot_y)
- *pivot_y = pd->rel_pivot.y;
+ if (from_degree)
+ *from_degree = pd->from.degree;
- if (pivot_z)
- *pivot_z = pd->rel_pivot.z;
+ if (to_degree)
+ *to_degree = pd->to.degree;
+
+ if (pivot)
+ *pivot = pd->rel_pivot.obj;
+
+ if (cx)
+ *cx = pd->rel_pivot.cx;
+
+ if (cy)
+ *cy = pd->rel_pivot.cy;
}
EOLIAN static void
-_efl_animation_rotate_absolute_pivot_set(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, Evas_Coord pivot_x, Evas_Coord pivot_y, Evas_Coord pivot_z)
+_efl_animation_rotate_rotate_absolute_set(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double from_degree, double to_degree, Evas_Coord cx, Evas_Coord cy)
{
EFL_ANIMATION_ROTATE_CHECK_OR_RETURN(eo_obj);
- pd->abs_pivot.x = pivot_x;
- pd->abs_pivot.y = pivot_y;
- pd->abs_pivot.z = pivot_z;
+ pd->from.degree = from_degree;
+ pd->to.degree = to_degree;
+
+ pd->abs_pivot.cx = cx;
+ pd->abs_pivot.cy = cy;
+
+ //Update relative pivot based on absolute pivot
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
+
+ Eo *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
+
+ pd->rel_pivot.obj = NULL;
+
+ if (w != 0)
+ pd->rel_pivot.cx = (double)(cx - x) / w;
+ else
+ pd->rel_pivot.cx = 0.0;
+
+ if (h != 0)
+ pd->rel_pivot.cy = (double)(cy - y) / h;
+ else
+ pd->rel_pivot.cy = 0.0;
pd->use_rel_pivot = EINA_FALSE;
}
EOLIAN static void
-_efl_animation_rotate_absolute_pivot_get(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, Evas_Coord *pivot_x, Evas_Coord *pivot_y, Evas_Coord *pivot_z)
+_efl_animation_rotate_rotate_absolute_get(Eo *eo_obj, Evas_Object_Animation_Rotate_Data *pd, double *from_degree, double *to_degree, Evas_Coord *cx, Evas_Coord *cy)
{
EFL_ANIMATION_ROTATE_CHECK_OR_RETURN(eo_obj);
- if (pivot_x)
- *pivot_x = pd->abs_pivot.x;
-
- if (pivot_y)
- *pivot_y = pd->abs_pivot.y;
-
- if (pivot_z)
- *pivot_z = pd->abs_pivot.z;
+ //Update relative pivot based on absolute pivot
+ if (pd->use_rel_pivot)
+ {
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+ Evas_Coord w = 0;
+ Evas_Coord h = 0;
+
+ if (pd->rel_pivot.obj)
+ evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
+ else
+ {
+ Eo *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, &w, &h);
+ }
+
+ pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
+ pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
+ }
+
+ if (from_degree)
+ *from_degree = pd->from.degree;
+
+ if (to_degree)
+ *to_degree = pd->to.degree;
+
+ if (cx)
+ *cx = pd->abs_pivot.cx;
+
+ if (cy)
+ *cy = pd->abs_pivot.cy;
}
EOLIAN static Efl_Animation *
@@ -140,16 +218,15 @@ _efl_animation_rotate_efl_animation_dup(Eo *eo_obj, Evas_Object_Animation_Rotate
EFL_ANIMATION_ROTATE_DATA_GET(animation, new_pd);
- new_pd->from.angle = pd->from.angle;
- new_pd->to.angle = pd->to.angle;
+ new_pd->from.degree = pd->from.degree;
+ new_pd->to.degree = pd->to.degree;
- new_pd->rel_pivot.x = pd->rel_pivot.x;
- new_pd->rel_pivot.y = pd->rel_pivot.y;
- new_pd->rel_pivot.z = pd->rel_pivot.z;
+ new_pd->rel_pivot.obj = pd->rel_pivot.obj;
+ new_pd->rel_pivot.cx = pd->rel_pivot.cx;
+ new_pd->rel_pivot.cy = pd->rel_pivot.cy;
- new_pd->abs_pivot.x = pd->rel_pivot.x;
- new_pd->abs_pivot.y = pd->rel_pivot.y;
- new_pd->abs_pivot.z = pd->rel_pivot.z;
+ new_pd->abs_pivot.cx = pd->rel_pivot.cx;
+ new_pd->abs_pivot.cy = pd->rel_pivot.cy;
new_pd->use_rel_pivot = pd->use_rel_pivot;
@@ -173,18 +250,23 @@ _efl_animation_rotate_efl_animation_instance_create(Eo *eo_obj, Evas_Object_Anim
double duration = efl_animation_duration_get(eo_obj);
efl_animation_instance_duration_set(instance, duration);
- efl_animation_instance_rotate_angle_set(instance,
- pd->from.angle, pd->to.angle);
-
- efl_animation_instance_rotate_relative_pivot_set(instance,
- pd->rel_pivot.x,
- pd->rel_pivot.y,
- pd->rel_pivot.z);
-
- efl_animation_instance_rotate_absolute_pivot_set(instance,
- pd->abs_pivot.x,
- pd->abs_pivot.y,
- pd->abs_pivot.z);
+ if (pd->use_rel_pivot)
+ {
+ efl_animation_instance_rotate_set(instance,
+ pd->from.degree,
+ pd->to.degree,
+ pd->rel_pivot.obj,
+ pd->rel_pivot.cx,
+ pd->rel_pivot.cy);
+ }
+ else
+ {
+ efl_animation_instance_rotate_absolute_set(instance,
+ pd->from.degree,
+ pd->to.degree,
+ pd->abs_pivot.cx,
+ pd->abs_pivot.cy);
+ }
return instance;
}
@@ -194,16 +276,15 @@ _efl_animation_rotate_efl_object_constructor(Eo *eo_obj, Evas_Object_Animation_R
{
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
- pd->from.angle = 0.0;
- pd->to.angle = 0.0;
+ pd->from.degree = 0.0;
+ pd->to.degree = 0.0;
- pd->rel_pivot.x = 0.5;
- pd->rel_pivot.y = 0.5;
- pd->rel_pivot.z = 0.5;
+ pd->rel_pivot.obj = NULL;
+ pd->rel_pivot.cx = 0.5;
+ pd->rel_pivot.cy = 0.5;
- pd->abs_pivot.x = 0;
- pd->abs_pivot.y = 0;
- pd->abs_pivot.z = 0;
+ pd->abs_pivot.cx = 0;
+ pd->abs_pivot.cy = 0;
pd->use_rel_pivot = EINA_TRUE;
diff --git a/src/lib/evas/canvas/efl_animation_rotate.eo b/src/lib/evas/canvas/efl_animation_rotate.eo
index 50b9a6227b..ec0f813374 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.eo
+++ b/src/lib/evas/canvas/efl_animation_rotate.eo
@@ -6,36 +6,29 @@ class Efl.Animation.Rotate (Efl.Animation)
legacy_prefix: evas_object_animation;
data: Evas_Object_Animation_Rotate_Data;
methods {
- @property angle {
+ @property rotate {
set {
}
get {
}
values {
- from_angle: double; [[Rotation angle when animation starts]]
- to_angle: double; [[Rotation angle when animation ends]]
+ from_degree: double; [[Rotation degree when animation starts]]
+ to_degree: double; [[Rotation degree when animation ends]]
+ pivot: Efl.Canvas.Object; [[Pivot object for the center point. If the pivot object is NULL, then the object is rotated on itself.]]
+ cx: double; [[X relative coordinate of the center point. The left end is 0.0 and the right end is 1.0 (the center is 0.5).]]
+ cy: double; [[Y relative coordinate of the center point. The top end is 0.0 and the bottom end is 1.0 (the center is 0.5).]]
}
}
- @property relative_pivot {
+ @property rotate_absolute {
set {
}
get {
}
values {
- x: double; [[Relative pivot value along x axis. The left is 0.0 and the right is 1.0.]]
- y: double; [[Relative pivot value along x axis. The top is 0.0 and the bottom is 1.0.]]
- z: double; [[Relative pivot value along x axis. The front is 0.0 and the rear is 1.0.]]
- }
- }
- @property absolute_pivot {
- set {
- }
- get {
- }
- values {
- x: int; [[Absolute pivot value along x axis]]
- y: int; [[Absolute pivot value along x axis]]
- z: int; [[Absolute pivot value along x axis]]
+ from_degree: double; [[Rotation degree when animation starts]]
+ to_degree: double; [[Rotation degree when animation ends]]
+ cx: int; [[X absolute coordinate of the center point.]]
+ cy: int; [[Y absolute coordinate of the center point.]]
}
}
}