Do not allow zero as number of frames in ClutterTimeline
A timeline with no frames is not valid, so we simply disallow setting ClutterTimeline:num-frames to 0.
This commit is contained in:
parent
cd100b4168
commit
34a119f8a7
@ -273,7 +273,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
|||||||
g_param_spec_uint ("fps",
|
g_param_spec_uint ("fps",
|
||||||
"Frames Per Second",
|
"Frames Per Second",
|
||||||
"Timeline frames per second",
|
"Timeline frames per second",
|
||||||
0, 1000,
|
1, 1000,
|
||||||
50,
|
50,
|
||||||
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
||||||
/**
|
/**
|
||||||
@ -286,8 +286,8 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
|||||||
g_param_spec_uint ("num-frames",
|
g_param_spec_uint ("num-frames",
|
||||||
"Total number of frames",
|
"Total number of frames",
|
||||||
"Timelines total number of frames",
|
"Timelines total number of frames",
|
||||||
0, G_MAXUINT,
|
1, G_MAXUINT,
|
||||||
0,
|
1,
|
||||||
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
|
||||||
/**
|
/**
|
||||||
* ClutterTimeline:loop:
|
* ClutterTimeline:loop:
|
||||||
@ -846,6 +846,9 @@ ClutterTimeline*
|
|||||||
clutter_timeline_new (guint n_frames,
|
clutter_timeline_new (guint n_frames,
|
||||||
guint fps)
|
guint fps)
|
||||||
{
|
{
|
||||||
|
g_return_val_if_fail (n_frames > 0, NULL);
|
||||||
|
g_return_val_if_fail (fps > 0, NULL);
|
||||||
|
|
||||||
return g_object_new (CLUTTER_TYPE_TIMELINE,
|
return g_object_new (CLUTTER_TYPE_TIMELINE,
|
||||||
"fps", fps,
|
"fps", fps,
|
||||||
"num-frames", n_frames,
|
"num-frames", n_frames,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user