Touch and resize issues on mobile android chome
CrazyFlasher opened this issue · 9 comments
Using this sample
https://github.com/haxeui/component-examples/tree/master/buttons
http://188.166.108.195/testui/ - build
- Touches doesn't work
- Content is shown only in landscape mode
- After rotating device - weird scaling
Scaling content issues can be easily reproduced on desktop. Just resize the window.
Took latest git of heaps, haxeui-code and haxeui-heaps
Build script:
-cp src
-main Main
-lib haxeui-core
-lib haxeui-heaps
-lib heaps
-js build/html5/Main.js
Is heaps supported in mobile browers? My understanding was that heaps wasnt a mobile framework... but maybe thats inaccurate?
https://heaps.io/samples/index.html
Yes, it is supported
Right, so i guess ill have to test it a little... the scaling one is fairly easy, its because the canvas in your test app is 100%x100%... so i suppose it makes sense that its scaled all weird... not sure a good way around that...
I mean, if you take one of those heaps samples and make it full page 100%x100% then i guess they will also behave strangely wrt to scale?
Although interestingly, when i look at them in fullscreen:
https://heaps.io/samples/adjustColor/
or
And resize the browser things look alright... i can see heaps stuttering though so it looks like its doing something ill have to take a look and see - but it wont be till the weekend most likely since it doesnt look like a 5 second job
Cheers,
Ian
I mean, if you take one of those heaps samples and make it full page 100%x100% then i guess they will also behave strangely wrt to scale?
Scaling is fine for samples. For ex. check this sample:
http://188.166.108.195/heaps/build/base2D/
And resize the browser things look alright... i can see heaps stuttering though so it looks like its doing something ill have to take a look and see - but it wont be till the weekend most likely since it doesnt look like a 5 second job
thanks!
I've build heaps samples from github and got the same scaling issue:
The html are exactly the same,
Howerver on their site resizing page works fine. I've report the issue in heaps repo
https://heaps.io/samples/base2D/
I found what causes the issue and it is heaps related:
HeapsIO/heaps#986
My touch input is working on JS (iPhone Safari browser), but the x,y of the touch is always 0,0. This is because Window.getInstance().mouseX/Y
are not updated on touch. event.relX/Y
are what is updated. I would have to mess with scaling and stuff before just committing this, as that may not be the right numbers to report to HaxeUI.
Interesting, so could relX / relY be use "across the board" (ie, even on desktop)
Seems to work fine, yeah... i mean, its relative, but its relative to the root (which is usually s2d), so i guess thats fine, and the same as window absolute i would guess.