From 048fcea988446af1ce18356eb1718f85088e73c8 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 2 Mar 2010 18:30:31 +0000 Subject: [PATCH] clutter-actor: Initialize with the identity matrix in get_transform The documentation and name of the get_transformation_matrix function implies that 'matrix' is purely an out parameter. However it wasn't initializing the matrix before calling the 'apply_transform' virtual so it was basically just a wrapper for the virtual. The virtual assumes the matrix parameter is in/out and applies the actor's transformation on top of any existing transformations. This causes unexpected semantics that are inconsistent with the documentation. --- clutter/clutter-actor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index faf9daf9e..96f9365b2 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -9802,6 +9802,8 @@ clutter_actor_get_transformation_matrix (ClutterActor *self, { g_return_if_fail (CLUTTER_IS_ACTOR (self)); + cogl_matrix_init_identity (matrix); + CLUTTER_ACTOR_GET_CLASS (self)->apply_transform (self, matrix); }