Commit 1cfd406f authored by Kristian Høgsberg's avatar Kristian Høgsberg

shell: Tweak spring animation for zoom animation type

parent 8eb0f4f8
......@@ -239,8 +239,16 @@ WL_EXPORT struct weston_surface_animation *
weston_zoom_run(struct weston_surface *surface, float start, float stop,
weston_surface_animation_done_func_t done, void *data)
{
return weston_surface_animation_run(surface, start, stop,
struct weston_surface_animation *zoom;
zoom = weston_surface_animation_run(surface, start, stop,
zoom_frame, done, data);
weston_spring_init(&zoom->spring, 300.0, start, stop);
zoom->spring.friction = 1400;
zoom->spring.previous = start - (stop - start) * 0.03;
return zoom;
}
static void
......
......@@ -3459,7 +3459,7 @@ map(struct desktop_shell *shell, struct weston_surface *surface,
weston_fade_run(surface, 0.0, 1.0, 300.0, NULL, NULL);
break;
case ANIMATION_ZOOM:
weston_zoom_run(surface, 0.8, 1.0, NULL, NULL);
weston_zoom_run(surface, 0.5, 1.0, NULL, NULL);
break;
default:
break;
......
......@@ -42,7 +42,7 @@ int
main(int argc, char *argv[])
{
const double k = 300.0;
const double current = 0.0;
const double current = 0.5;
const double target = 1.0;
const double friction = 1400;
......@@ -51,7 +51,7 @@ main(int argc, char *argv[])
weston_spring_init(&spring, k, current, target);
spring.friction = friction;
spring.previous = -0.03;
spring.previous = 0.48;
spring.timestamp = 0;
while (!weston_spring_done(&spring)) {
......
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