Added initial touch events to support iOS

This commit is contained in:
Sebastian Imlay 2019-11-11 20:29:58 -08:00
parent 9da6ce474c
commit e19a07d400
13 changed files with 165 additions and 47 deletions

View file

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