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.
Ander Conselvan de Oliveira 12 years ago committed by Kristian Høgsberg
parent 6655e00e03
commit 434e8f3ae1
  1. 3
      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 &&

Loading…
Cancel
Save