darthdeus / comfy

Comfy is a fun 2D game engine built in Rust. It's designed to be opinionated, productive, and easy to use.
https://comfyengine.org
Apache License 2.0
678 stars 28 forks source link

[WASM, Windows] Mouse position incorrect with screen DPI 150% (UI interaction broken) #73

Open nokola opened 8 months ago

nokola commented 8 months ago
  1. Set monitor to 150% DPI in Windows 10
  2. Open https://comfyengine.org/examples/
  3. Click blood_canvas example
  4. Click letter "f"

Expected: blood under "f" Actual: blood offset lower right image

Note: this breaks UI interaction like button clicks as well due to mouse pos issues.

darthdeus commented 8 months ago

Does this only happen for you on the web, or also on desktop?

nokola commented 8 months ago

Web only

nokola commented 7 months ago

I can see a high DPI issue on Windows now.

150% DPI offsets the egui window incorrectly. It's supposed to be centered below: image

darthdeus commented 7 months ago

Windows bug should be fixed now, WASM isn't yet.

darthdeus commented 7 months ago

Seems this issue is fixed in WASM too but not on the website. I wonder if there's something wrong with the website that further stretches the canvas or something that causes this, but it doesn't seem to happen when running https://github.com/darthdeus/comfy/tree/master/demos/egui-scaling through wasm-server-runner