haxeui / haxeui-heaps

MIT License
31 stars 12 forks source link

Touch and resize issues on mobile android chome #24

Open CrazyFlasher opened 3 years ago

CrazyFlasher commented 3 years ago

Using this sample https://github.com/haxeui/component-examples/tree/master/buttons

http://188.166.108.195/testui/ - build

  1. Touches doesn't work
  2. Content is shown only in landscape mode
  3. 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
ianharrigan commented 3 years ago

Is heaps supported in mobile browers? My understanding was that heaps wasnt a mobile framework... but maybe thats inaccurate?

CrazyFlasher commented 3 years ago

https://heaps.io/samples/index.html Yes, it is supported

ianharrigan commented 3 years ago

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

https://heaps.io/samples/pbr/

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

CrazyFlasher commented 3 years ago

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!

CrazyFlasher commented 3 years ago

I've build heaps samples from github and got the same scaling issue: image

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/

CrazyFlasher commented 3 years ago

I found what causes the issue and it is heaps related: https://github.com/HeapsIO/heaps/issues/986

MSGhero commented 2 years ago

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.

ianharrigan commented 2 years ago

Interesting, so could relX / relY be use "across the board" (ie, even on desktop)

ianharrigan commented 2 years ago

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.