From 3a869019eb76b3079944228a7e2fa4a9789681bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 19 Mar 2014 16:45:23 -0700 Subject: [PATCH] animation: Fix the fade animation to work in both directions We'll use this for fading out windows. --- src/animation.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/animation.c b/src/animation.c index 33875d99d..521e4f18b 100644 --- a/src/animation.c +++ b/src/animation.c @@ -206,7 +206,7 @@ weston_view_animation_run(struct weston_view *view, weston_matrix_init(&animation->transform.matrix); wl_list_insert(&view->geometry.transformation_list, &animation->transform.link); - weston_spring_init(&animation->spring, 200.0, 0.0, 1.0); + weston_spring_init(&animation->spring, 200.0, start, stop); animation->spring.friction = 700; animation->animation.frame_counter = 0; animation->animation.frame = weston_view_animation_frame; @@ -290,17 +290,17 @@ weston_fade_run(struct weston_view *view, { struct weston_view_animation *fade; - fade = weston_view_animation_run(view, 0, end, + fade = weston_view_animation_run(view, start, end, fade_frame, reset_alpha, done, data, NULL); if (fade == NULL) return NULL; - weston_spring_init(&fade->spring, k, start, end); + fade->spring.k = 1000.0; - fade->spring.friction = 1400; - fade->spring.previous = -(end - start) * 0.03; + fade->spring.friction = 4000; + fade->spring.previous = start - (end - start) * 0.1; view->alpha = start;