mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
vertex: Register progress function
This allows animating properties storing a ClutterVertex.
This commit is contained in:
parent
4931802fee
commit
7a54bdc65d
@ -9302,17 +9302,41 @@ clutter_vertex_equal (const ClutterVertex *vertex_a,
|
||||
vertex_a->z == vertex_b->z;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_vertex_progress (const GValue *a,
|
||||
const GValue *b,
|
||||
gdouble progress,
|
||||
GValue *retval)
|
||||
{
|
||||
const ClutterVertex *av = g_value_get_boxed (a);
|
||||
const ClutterVertex *bv = g_value_get_boxed (b);
|
||||
ClutterVertex res = { 0, };
|
||||
|
||||
res.x = av->x + (bv->x - av->x) * progress;
|
||||
res.y = av->y + (bv->y - av->y) * progress;
|
||||
res.z = av->z + (bv->z - av->z) * progress;
|
||||
|
||||
g_value_set_boxed (retval, &res);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GType
|
||||
clutter_vertex_get_type (void)
|
||||
{
|
||||
static GType our_type = 0;
|
||||
|
||||
if (G_UNLIKELY (our_type == 0))
|
||||
{
|
||||
our_type =
|
||||
g_boxed_type_register_static (I_("ClutterVertex"),
|
||||
(GBoxedCopyFunc) clutter_vertex_copy,
|
||||
(GBoxedFreeFunc) clutter_vertex_free);
|
||||
|
||||
clutter_interval_register_progress_func (our_type,
|
||||
clutter_vertex_progress);
|
||||
}
|
||||
|
||||
return our_type;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user