Turn Touch into a struct and add finger id

This commit is contained in:
Héctor Ramón Jiménez 2020-03-19 12:17:16 +01:00
parent e19a07d400
commit d3572e1b81
13 changed files with 151 additions and 112 deletions

View file

@ -5,7 +5,7 @@
//! [`TextInput`]: struct.TextInput.html
//! [`State`]: struct.State.html
use crate::{
input::{keyboard, mouse, touch, ButtonState},
input::{keyboard, mouse, touch, ButtonState, Touch},
layout, Clipboard, Element, Event, Font, Hasher, Layout, Length, Point,
Rectangle, Size, Widget,
};
@ -203,7 +203,10 @@ where
button: mouse::Button::Left,
state: ButtonState::Pressed,
})
| Event::Touch(touch::Touch::Started { .. }) => {
| Event::Touch(Touch {
phase: touch::Phase::Started,
..
}) => {
let is_clicked = layout.bounds().contains(cursor_position);
if is_clicked {