From 3df6b85959f015af631bd024afef872979810ade Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 20 May 2009 17:38:45 +0100 Subject: Fixes for Clutter 1.0 API changes --- tests/test-yuv-upload.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/test-yuv-upload.c b/tests/test-yuv-upload.c index 2948c9b..c727b57 100644 --- a/tests/test-yuv-upload.c +++ b/tests/test-yuv-upload.c @@ -38,22 +38,30 @@ size_change (ClutterTexture *texture, gint height, gpointer user_data) { - gint new_x, new_y, new_width, new_height; + ClutterActor *stage; + gfloat new_x, new_y, new_width, new_height; + gfloat stage_width, stage_height; - new_height = ( height * CLUTTER_STAGE_WIDTH() ) / width; - if (new_height <= CLUTTER_STAGE_HEIGHT()) + stage = clutter_actor_get_stage (CLUTTER_ACTOR (texture)); + if (stage == NULL) + return; + + clutter_actor_get_size (stage, &stage_width, &stage_height); + + new_height = ( height * stage_width ) / width; + if (new_height <= stage_height) { - new_width = CLUTTER_STAGE_WIDTH(); + new_width = stage_width; new_x = 0; - new_y = (CLUTTER_STAGE_HEIGHT() - new_height) / 2; + new_y = (stage_height - new_height) / 2; } else { - new_width = ( width * CLUTTER_STAGE_HEIGHT() ) / height; - new_height = CLUTTER_STAGE_HEIGHT(); + new_width = ( width * stage_height ) / height; + new_height = stage_height; - new_x = (CLUTTER_STAGE_WIDTH() - new_width) / 2; + new_x = (stage_width - new_width) / 2; new_y = 0; } -- cgit v1.2.3