summaryrefslogtreecommitdiff
path: root/src/zoom.c
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2012-11-21 15:11:36 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-11-21 11:40:39 -0500
commit434e8f3ae110ce2990a974af01b81f856ed7ce2e (patch)
tree2318f329a089c0bd69f2b988cb77db9789e5aaaf /src/zoom.c
parent6655e00e036179073f791c7b086b6025ce98967c (diff)
downloadweston-434e8f3ae110ce2990a974af01b81f856ed7ce2e.tar.gz
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.
Diffstat (limited to 'src/zoom.c')
-rw-r--r--src/zoom.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/zoom.c b/src/zoom.c
index 3be27f61..d57b8683 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 &&