Commit e7693b79 authored by Jiří Techet's avatar Jiří Techet Committed by Pierre-Luc Beaudoin

Lie a bit about not fading in

Even if fade-in is set to false, fade in a little. This is much more
eye-pleasing than displaying the tile directly, which causes flickering
effect when panning and loading tiles from the cache. Slight fade-in
looks much more natural and when it's short enough, it's not annoying.
Signed-off-by: default avatarJiří Techet <techet@gmail.com>
parent bce55b53
......@@ -525,26 +525,31 @@ champlain_tile_set_state (ChamplainTile *self, ChamplainState state)
if (state == CHAMPLAIN_STATE_DONE && priv->content_actor &&
clutter_actor_get_parent (priv->content_actor) != CLUTTER_ACTOR (self))
{
if (!priv->fade_in)
clutter_group_remove_all (CLUTTER_GROUP (self));
clutter_container_add_actor (CLUTTER_CONTAINER (self), priv->content_actor);
if (priv->fade_in)
{
ClutterAnimation *animation;
ClutterAnimation *animation;
clutter_actor_set_opacity (priv->content_actor, 0);
clutter_actor_set_opacity (priv->content_actor, 0);
if (priv->fade_in)
{
animation = clutter_actor_animate (priv->content_actor,
CLUTTER_EASE_IN_CUBIC,
500,
"opacity", 255,
NULL);
g_object_ref (self);
g_signal_connect (animation, "completed", G_CALLBACK (fade_in_completed), self);
}
else
{
animation = clutter_actor_animate (priv->content_actor,
CLUTTER_LINEAR,
150,
"opacity", 255,
NULL);
}
g_object_ref (self);
g_signal_connect (animation, "completed", G_CALLBACK (fade_in_completed), self);
}
priv->state = state;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment