forked from enlightenment/efl
efl_canvas_animation: be more explicit with errors
Summary: with this commit invalid values are not accepted silently anymore. But rather a error will be raised. Depends on D10350 Reviewers: segfaultxavi, Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8288 Differential Revision: https://phab.enlightenment.org/D10558
This commit is contained in:
parent
f47b927745
commit
92a4fab5d7
|
@ -38,8 +38,7 @@ _efl_canvas_animation_repeat_mode_set(Eo *eo_obj EINA_UNUSED,
|
||||||
Efl_Canvas_Animation_Data *pd,
|
Efl_Canvas_Animation_Data *pd,
|
||||||
Efl_Canvas_Animation_Repeat_Mode mode)
|
Efl_Canvas_Animation_Repeat_Mode mode)
|
||||||
{
|
{
|
||||||
if ((mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_RESTART) ||
|
EINA_SAFETY_ON_FALSE_RETURN(mode >= 0 && mode < EFL_CANVAS_ANIMATION_REPEAT_MODE_LAST);
|
||||||
(mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE))
|
|
||||||
pd->repeat_mode = mode;
|
pd->repeat_mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,8 +53,7 @@ _efl_canvas_animation_repeat_count_set(Eo *eo_obj EINA_UNUSED,
|
||||||
Efl_Canvas_Animation_Data *pd,
|
Efl_Canvas_Animation_Data *pd,
|
||||||
int count)
|
int count)
|
||||||
{
|
{
|
||||||
//EFL_ANIMATION_REPEAT_INFINITE repeats animation infinitely
|
EINA_SAFETY_ON_FALSE_RETURN(count >= EFL_ANIMATION_REPEAT_INFINITE);
|
||||||
if ((count < 0) && (count != EFL_ANIMATION_REPEAT_INFINITE)) return;
|
|
||||||
|
|
||||||
pd->repeat_count = count;
|
pd->repeat_count = count;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +69,7 @@ _efl_canvas_animation_start_delay_set(Eo *eo_obj EINA_UNUSED,
|
||||||
Efl_Canvas_Animation_Data *pd,
|
Efl_Canvas_Animation_Data *pd,
|
||||||
double sec)
|
double sec)
|
||||||
{
|
{
|
||||||
if (sec < 0.0) return;
|
EINA_SAFETY_ON_FALSE_RETURN(sec < 0.0);
|
||||||
|
|
||||||
pd->start_delay_time = sec;
|
pd->start_delay_time = sec;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,5 +8,6 @@ enum @beta Efl.Canvas.Animation_Repeat_Mode
|
||||||
[[Animation repeat mode]]
|
[[Animation repeat mode]]
|
||||||
|
|
||||||
restart = 0, [[Restart animation when the animation ends.]]
|
restart = 0, [[Restart animation when the animation ends.]]
|
||||||
reverse [[Reverse animation when the animation ends.]]
|
reverse = 1, [[Reverse animation when the animation ends.]]
|
||||||
|
last
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue