//Rotate from 45 to 0 degrees Animation
Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
+ efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, EINA_VECTOR2(0.5, 0.5));
//Scale Animation to zoom out
Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
//Rotate from 0 to 45 degrees Animation
Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
+ efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, EINA_VECTOR2(0.5, 0.5));
//Scale Animation to zoom in
Efl_Canvas_Animation *scale_double_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
/* Animations to hide button */
//Rotate from 0 to 45 degrees Animation
Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
+ efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, EINA_VECTOR2(0.5, 0.5));
//Scale Animation to zoom in
Efl_Canvas_Animation *scale_double_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win);
//Rotate from 45 to 0 degrees Animation
Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
+ efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, EINA_VECTOR2(0.5, 0.5));
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
//Show Sequential Group Animation
//Rotate from 0 to 45 degrees Animation
Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0,NULL, 0.5, 0.5);
+ efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, EINA_VECTOR2(0.5, 0.5));
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
+ efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, EINA_VECTOR2(0.5, 0.5));
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Rotate from 0 to 45 degrees Animation
Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, pivot, 0.5, 0.5);
+ efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, pivot, EINA_VECTOR2(0.5, 0.5));
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, pivot, 0.5, 0.5);
+ efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, pivot, EINA_VECTOR2(0.5, 0.5));
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Rotate from 0 to 45 degrees Animation
Efl_Canvas_Animation *cw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_absolute_set(cw_45_degrees_anim, 0.0, 45.0, 0, 0);
+ efl_animation_rotate_absolute_set(cw_45_degrees_anim, 0.0, 45.0, EINA_POSITION2D(0, 0));
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win);
- efl_animation_rotate_absolute_set(ccw_45_degrees_anim, 45.0, 0.0, 0, 0);
+ efl_animation_rotate_absolute_set(ccw_45_degrees_anim, 45.0, 0.0, EINA_POSITION2D(0, 0));
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
typedef struct _Eina_Vector2 Eina_Vector2;
typedef struct _Eina_Vector3 Eina_Vector3;
+#define EINA_VECTOR2(x, y) ((Eina_Vector2) {(x), (y)})
/**
* @internal
* @defgroup Eina_Vector2 Vectors in floating point
double from_degree,
double to_degree,
Efl_Canvas_Object *pivot,
- double cx,
- double cy)
+ Eina_Vector2 center_point)
{
pd->from.degree = from_degree;
pd->to.degree = to_degree;
//TODO: check whether ref for pivot should be added.
pd->rel_pivot.obj = pivot;
- pd->rel_pivot.cx = cx;
- pd->rel_pivot.cy = cy;
+ pd->rel_pivot.pos = center_point;
pd->use_rel_pivot = EINA_TRUE;
}
double *from_degree,
double *to_degree,
Efl_Canvas_Object **pivot,
- double *cx,
- double *cy)
+ Eina_Vector2 *center_point)
{
if (!pd->use_rel_pivot)
{
if (pivot)
*pivot = pd->rel_pivot.obj;
- if (cx)
- *cx = pd->rel_pivot.cx;
-
- if (cy)
- *cy = pd->rel_pivot.cy;
+ if (center_point)
+ *center_point = pd->rel_pivot.pos;
}
EOLIAN static void
Efl_Canvas_Animation_Rotate_Data *pd,
double from_degree,
double to_degree,
- Evas_Coord cx,
- Evas_Coord cy)
+ Eina_Position2D abs)
{
pd->from.degree = from_degree;
pd->to.degree = to_degree;
- pd->abs_pivot.cx = cx;
- pd->abs_pivot.cy = cy;
+ pd->abs_pivot = abs;
pd->use_rel_pivot = EINA_FALSE;
}
Efl_Canvas_Animation_Rotate_Data *pd,
double *from_degree,
double *to_degree,
- Evas_Coord *cx,
- Evas_Coord *cy)
+ Eina_Position2D *abs)
{
if (pd->use_rel_pivot)
{
if (to_degree)
*to_degree = pd->to.degree;
- if (cx)
- *cx = pd->abs_pivot.cx;
-
- if (cy)
- *cy = pd->abs_pivot.cy;
+ if (abs)
+ *abs = pd->abs_pivot;
}
EOLIAN static double
efl_gfx_mapping_rotate(target,
new_degree,
(pd->rel_pivot.obj) ? pd->rel_pivot.obj : target,
- pd->rel_pivot.cx, pd->rel_pivot.cy);
+ pd->rel_pivot.pos.x, pd->rel_pivot.pos.y);
}
else
{
efl_gfx_mapping_rotate_absolute(target,
new_degree,
- pd->abs_pivot.cx, pd->abs_pivot.cy);
+ pd->abs_pivot.x, pd->abs_pivot.y);
}
return progress;
pd->to.degree = 0.0;
pd->rel_pivot.obj = NULL;
- pd->rel_pivot.cx = 0.5;
- pd->rel_pivot.cy = 0.5;
+ pd->rel_pivot.pos.x = 0.5;
+ pd->rel_pivot.pos.y = 0.5;
- pd->abs_pivot.cx = 0;
- pd->abs_pivot.cy = 0;
+ pd->abs_pivot.x = 0;
+ pd->abs_pivot.y = 0;
pd->use_rel_pivot = EINA_TRUE;
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).]]
+ center_point : Eina.Vector2; [[Relative coordinate of the center point.]]
}
}
@property rotate_absolute {
values {
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.]]
+ center_pointer : Eina.Position2D; [[absolute coordinate of the center point.]]
}
}
}
double degree;
} Efl_Canvas_Animation_Rotate_Property;
-typedef struct _Efl_Canvas_Animation_Rotate_Absolute_Pivot
-{
- Evas_Coord cx, cy;
-} Efl_Canvas_Animation_Rotate_Absolute_Pivot;
-
typedef struct _Efl_Canvas_Animation_Rotate_Relative_Pivot
{
Efl_Canvas_Object *obj;
- double cx, cy;
+ Eina_Vector2 pos;
} Efl_Canvas_Animation_Rotate_Relative_Pivot;
typedef struct _Efl_Canvas_Animation_Rotate_Data
Efl_Canvas_Animation_Rotate_Property from;
Efl_Canvas_Animation_Rotate_Property to;
- Efl_Canvas_Animation_Rotate_Absolute_Pivot abs_pivot;
+ Eina_Position2D abs_pivot;
Efl_Canvas_Animation_Rotate_Relative_Pivot rel_pivot;
Eina_Bool use_rel_pivot;