TouchControls icon indicating copy to clipboard operation
TouchControls copied to clipboard

Change device orientation

Open gjhatzis opened this issue 3 years ago • 1 comments

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?

gjhatzis avatar Dec 28 '22 14:12 gjhatzis

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

mese79 avatar Jan 21 '23 20:01 mese79