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

@ -2,7 +2,7 @@
use std::hash::Hash;
use crate::{
input::{mouse, ButtonState},
input::{mouse, touch::Touch, ButtonState},
layout, row, text, Align, Clipboard, Element, Event, Font, Hasher,
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
VerticalAlignment, Widget,
@ -155,7 +155,8 @@ where
Event::Mouse(mouse::Event::Input {
button: mouse::Button::Left,
state: ButtonState::Pressed,
}) => {
})
| Event::Touch(Touch::Started { .. }) => {
let mouse_over = layout.bounds().contains(cursor_position);
if mouse_over {