[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.
This commit is contained in:
Emmanuele Bassi 2009-01-12 17:09:47 +00:00
parent 168d558bcf
commit 5ed62aaf76

View File

@ -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