tasgon / bevy_iced

Iced integration for Bevy
Other
121 stars 14 forks source link

Fix touch and wasm texture format error #20

Closed EmperialDev closed 1 year ago

EmperialDev commented 1 year ago

This may fix #15, I don't have the means to test on ios, but it works for the web and windows touchscreen device. It should also fix #9, with the workaround.

I implemented the fix for #9 by @nikolajevs86, so it now works on the web.

Then I added some missing scaling for the touch input, so now the touch input works as expected.

I also changed the order of mouse input and touch input, because I notice that when you use a windows touchscreen device, the touch would register at the mouse pos, if the mouse was inside the window.

EmperialDev commented 1 year ago

Why is touch behind a feature? Both bevy and iced supports touch natively, so why souldn't this libary not also that? But I understand that it makes it more flexible, but then maybe just make touch a default feature, then people can turn it off, if they really don't want it.

tasgon commented 1 year ago

PR seems fine, but I'm too tired to review/merge it right now. I'll get back to you tomorrow afternoon.

Why is touch behind a feature?

Honestly, I hadn't looked into iced's touch support for a long time, so I wasn't sure how stable it was. I also don't have any (non-painful) way of testing the touch support, so I wanted it to be easy for users to completely disable it should problems arise. Now, I'm not sure if it's still worth feature-gating it, so I'll look into removing that.

EmperialDev commented 1 year ago

If you use chrome devtools you can simulate touch on the web.

tasgon commented 1 year ago

This seems to work (but text rendering seems kinda screwy on wasm for me, could have something to do with https://github.com/iced-rs/iced/issues/1900). Merging, thanks for the PR!

tasgon commented 1 year ago

Release published