Ultralight icon indicating copy to clipboard operation
Ultralight copied to clipboard

device_scale_hint has no effect on mouse coordinate

Open mrsaleh opened this issue 4 years ago • 1 comments

Code:

Platform& platform = Platform::instance();
Config config;
config.device_scale_hint = 2.0;
platform.set_config(config);

<a href="#"><img src="sample.jpeg"></a>

Issue: The problem is that when I set device_scale_hint , the link doesn't work anymore , and suddenly I found that if I click in a blank area in the window , it follows the link , It took sometime that I figured out that the position that I was clicking was the actual coordinate that link supposed to be if device_scale_hint was 1.0

mrsaleh avatar Sep 21 '19 08:09 mrsaleh

Same problem, I tried using the "zoom" property in css to kinda cancel out the wrong scaling but it didn't fix anything. Apparently Ultralight rounds the scale values to the nearest 1/8th (0.125) but it doesn't apply that rounding when converting mouse coordinates from screen space.

As a result, a sidebar resizer/splitter in my page isn't doing anything when I hover my mouse over it, but when I move it slightly to the left then it works. This has caused a lot of headaches and wasted a huge amount of time.

bean-mhm avatar Nov 02 '22 12:11 bean-mhm