When a second canvas is visible, only animations in the first canvas
resulted in updates and visible animation. An animation in the second
canvas wouldn't result in repaints.
When we start an animation, we request a redraw on all windows and
return with `ControlFlow::Poll` to winit.
Winit then schedules an animation frame request, and in the callback the
redraw request events are delivered. For the first window we call
`update_animations()`, a new tick is detected (different than the
previous one) and animated properties are dirty and yield new windows.
Then right away we get called again with a redraw request for the second
window. update_animations() determines that the instant::now() is the
same, and has_animations() returns false. So at the end of the event
handler we return fail to return `Poll` and therefore no animation frame
request is created, which means the animations just stop.
Fix this by calling update_animations() only once, when all input events
have been processed and the redraw events are up for delivery next.
This is visible in the preview canvases in the documentation, if a
canvas other than the first has animations.
cc #215
Handle Input event from the input directly instead of going through winit
for the TextInput.
Note that this doesn't handle the composition event well, so the text is
only considered written when it is accepted
This also separates the blend-to-screen part of render_layer into a
helper function, as that will be useful in the future with public layer
elements.
Relates to #725
Delegate the decision how to implement the Clip element entirely into the backend,
where the GL backend can now explicitly render
children into a layer, instead of the hack with a layer in the renderer's
state and the extra save/restore pair.
The render function now takes a self_rc and returns a enum that permits
the implementation to handle rendering of children on its own and
thus make the caller skip that traversal step.
The Press and Release threshold where inverted.
Also increase the Flickable threshold because the precision of the
touch screen is too low, and if the threshold is too small, we
can't click on things inside a Flickable
- use both z1 and z2 to compute the pressure because these number
depends on the temperature so we need to use both
- check the pressure at the end of the reading in case it was
released when reading
- have different pressure threshold when the button is already
pressed so we avoid emitting a release too early
We need to use round_in() instead of cast() as cast() discard
too much data if both the x position and the width position are 0.5
then we loose one pixel of width
The computation of the coordinate was not correct. The coordinate was
turncated in the case of Image. And for Text, the image was drawn smaller
instead of being clipped