From 5ed62aaf76b49f9539d722f8b78ca99b8304a791 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 12 Jan 2009 17:09:47 +0000 Subject: [PATCH] [async-loading] Do not force the texture size on async load The size of the texture as retrieved by the filename should be set as the image size, not as the actor size, in order to respect the :sync-size property. When the asynchronous loading process terminates, we queue a relayout so that the scene is updated. --- clutter/clutter-texture.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index c1a55c3fe..71d1f288d 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -1440,6 +1440,8 @@ clutter_texture_async_load_complete (ClutterTexture *self, } g_signal_emit (self, texture_signals[LOAD_FINISHED], 0, error); + + clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); } static gboolean @@ -1560,7 +1562,10 @@ clutter_texture_async_load (ClutterTexture *self, return FALSE; } else - clutter_actor_set_size (CLUTTER_ACTOR (self), width, height); + { + priv->width = width; + priv->height = height; + } if (g_thread_supported ()) { @@ -1589,6 +1594,12 @@ clutter_texture_async_load (ClutterTexture *self, * Sets the #ClutterTexture image data from an image file. In case of * failure, %FALSE is returned and @error is set. * + * If #ClutterTexture:load-async is set to %TRUE, this function + * will return as soon as possible, and the actual image loading + * from disk will be performed asynchronously. #ClutterTexture::load-finished + * will be emitted when the image has been loaded or if an error + * occurred. + * * Return value: %TRUE if the image was successfully loaded and set * * Since: 0.8