Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change device orientation #5

Open
gjhatzis opened this issue Dec 28, 2022 · 1 comment
Open

Change device orientation #5

gjhatzis opened this issue Dec 28, 2022 · 1 comment

Comments

@gjhatzis
Copy link

Hello,

First of all thank you for the great work on touch controls!

I'm trying to apply them on mobile devices and everything works great until I change the device orientation.
If I reload the page on either portrait or landscape, everything works again.
I think the problem is in utils.js where you calculate the rect top and rect left with getBoundingClientRect, which do not change when viewport is.

Have you managed to find a solution?

@mese79
Copy link
Owner

mese79 commented Jan 21, 2023

Hi, sorry for the late response!
I just updated the code so on window resize event, pads' positions and configs get updated. I think that should do the work.
Checkout #0a309c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants