diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2009-05-20 17:38:45 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2009-05-20 17:38:45 +0100 |
commit | 3df6b85959f015af631bd024afef872979810ade (patch) | |
tree | 18424726480f4f1467fcb13171d4dd376af8d300 /tests | |
parent | 0ba90ccb6007ae5a3ca57d746455b82a84f0a57a (diff) |
Fixes for Clutter 1.0 API changes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-yuv-upload.c | 24 |
1 files changed, 16 insertions, 8 deletions
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; } |