struct wlsc_spring spring;
struct wlsc_transform transform;
struct wl_listener listener;
+ GLfloat start, stop;
void (*done)(struct wlsc_zoom *zoom, void *data);
void *data;
};
if (wlsc_spring_done(&zoom->spring))
wlsc_zoom_destroy(zoom);
- scale = zoom->spring.current;
+ scale = zoom->start +
+ (zoom->stop - zoom->start) * zoom->spring.current;
wlsc_matrix_init(&zoom->transform.matrix);
wlsc_matrix_translate(&zoom->transform.matrix,
-(es->x + es->width / 2.0),
es->x + es->width / 2.0,
es->y + es->height / 2.0, 0);
+ es->alpha = zoom->spring.current * 255;
+ if (es->alpha > 255)
+ es->alpha = 255;
scale = 1.0 / zoom->spring.current;
wlsc_matrix_init(&zoom->transform.inverse);
wlsc_matrix_scale(&zoom->transform.inverse, scale, scale, scale);
zoom->surface = surface;
zoom->done = done;
zoom->data = data;
+ zoom->start = start;
+ zoom->stop = stop;
surface->transform = &zoom->transform;
- wlsc_spring_init(&zoom->spring, 200.0, start, stop);
+ wlsc_spring_init(&zoom->spring, 200.0, 0.0, 1.0);
+ zoom->spring.friction = 700;
zoom->spring.timestamp = wlsc_compositor_get_time();
zoom->animation.frame = wlsc_zoom_frame;
wlsc_zoom_frame(&zoom->animation, NULL, zoom->spring.timestamp);