From: Louis-Francis Ratté-Boulianne <l...@collabora.com>

Don't scale to a size smaller than 1/8 the surface size
Adjust spring parameters so we don't go over the target value
---
 src/animation.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/animation.c b/src/animation.c
index 6f20179..835ed13 100644
--- a/src/animation.c
+++ b/src/animation.c
@@ -206,6 +206,9 @@ zoom_frame(struct weston_surface_animation *animation)
        scale = animation->start +
                (animation->stop - animation->start) *
                animation->spring.current;
+       if (scale < 0.125)
+               scale = 0.125;
+
        weston_matrix_init(&animation->transform.matrix);
        weston_matrix_translate(&animation->transform.matrix,
                                -0.5f * es->geometry.width,
@@ -224,8 +227,15 @@ 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, NULL);
+
+       zoom->spring.k = 400;
+       zoom->spring.friction = 1150;
+
+       return zoom;
 }
 
 static void
-- 
1.8.1.5

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to