The spring code stops when the current value is withing 0.0002 of the
target. In that case, round the value to 0.0 or 1.0 to enable the use
of fast paths, such as disabling blending in the GL renderer when an
opaque region is set.
static void
fade_frame(struct weston_surface_animation *animation)
{
- if (animation->spring.current > 1)
+ if (animation->spring.current > 0.999)
animation->surface->alpha = 1;
- else if (animation->spring.current < 0 )
+ else if (animation->spring.current < 0.001 )
animation->surface->alpha = 0;
else
animation->surface->alpha = animation->spring.current;