animation: also change stop value when updating a fade target
authorJonny Lamb <jonny.lamb@collabora.co.uk>
Tue, 29 Jul 2014 23:56:18 +0000 (00:56 +0100)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 30 Jul 2014 17:54:23 +0000 (10:54 -0700)
If we're fading a view with weston_fade_run() and half way through we
want to unfade it we can use weston_fade_update() to set a new alpha
target. When the animation finishes, reset_alpha() is called which
ensures the alpha value of the view is exactly as requested.

Although weston_fade_update() was updating the spring target so the
animation would look fine, it would then reset to the alpha target
given in the first call to weston_fade_run().

src/animation.c

index 5ded3ad..0febe41 100644 (file)
@@ -330,6 +330,7 @@ WL_EXPORT void
 weston_fade_update(struct weston_view_animation *fade, float target)
 {
        fade->spring.target = target;
+       fade->stop = target;
 }
 
 static void