Closed kevmeyer closed 1 month ago
Not sure if this is broken more generally, this fix also improves things on my Linux laptop with a high DPI screen:
@linusg did you set m_inverse_pixel_scaling_ratio = 1
unconditionally on your laptop to get a "working scaling"? If so, this means that this whole concept is broken .
Yes, that's what I did.
I can't be certain, but I think I know what the core issue is: 1px
in CSS is supposed to scale based on the device pixel size, but we don't support that yet. So, every px becomes one physical pixel. Spec: https://www.w3.org/TR/css-values-4/#reference-pixel
So the proper fix would be to implement that. Sounds like for now a good temporary fix would be to always set it to 1.0f
, with a FIXME comment explaining that it should be 1.0 / devicePixelRatio()
once LibWeb knows about HiDPI displays.
Currently, every website is wrongly scaled in macOS using a high dpi screen. Before:
After: