shell: Tweak spring animation for zoom animation type

Kristian Høgsberg 11 years ago
parent 8eb0f4f830
commit 1cfd406f9d
  1. 10
      src/animation.c
  2. 2
      src/shell.c
  3. 4
      src/spring-tool.c

@ -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)) {

Loading…
Cancel
Save