From 434e8f3ae110ce2990a974af01b81f856ed7ce2e Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Wed, 21 Nov 2012 15:11:36 +0200 Subject: [PATCH] zoom: Don't update the zoom translation if zoom level is 0 On the first frame with zoom activated, the spring used for animation will have a current value of zero. The translation calculated with that value will be invalid (not a number). Using this value later leads to having an invalid output matrix, so nothing is composited in the first zoomed frame. This problem is most evident when a sprite plane is being used. In that case, enabling the zoom will cause the surface to be moved back to the primary plane, but because of the bug described above, this surface would not actually be rendered causing a quick flicker. --- src/zoom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zoom.c b/src/zoom.c index 3be27f6..d57b868 100644 --- a/src/zoom.c +++ b/src/zoom.c @@ -251,7 +251,8 @@ weston_output_update_zoom_transform(struct weston_output *output) level = output->zoom.spring_z.current; ratio = 1 / level; - if (!output->zoom.active || level > output->zoom.max_level) + if (!output->zoom.active || level > output->zoom.max_level || + level == 0.0f) return; if (type == ZOOM_FOCUS_POINTER && -- 2.7.4