[libchamplain] Lie a bit about not fading in
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Lie a bit about not fading in
- Date: Tue, 23 Mar 2010 14:43:16 +0000 (UTC)
commit e7693b79032be4fc0eba5d86c88e8003ecb1f1d5
Author: JiÅ?Ã Techet <techet gmail com>
Date: Fri Mar 19 22:00:36 2010 +0100
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: JiÅ?Ã Techet <techet gmail com>
champlain/champlain-tile.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/champlain/champlain-tile.c b/champlain/champlain-tile.c
index b9baf65..21d201f 100644
--- a/champlain/champlain-tile.c
+++ b/champlain/champlain-tile.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]