Skip to content
This repository was archived by the owner on Jan 4, 2019. It is now read-only.

DIP <=> pixel conversions in Chromium are wrong #306

Open
bbondy opened this issue Sep 11, 2017 · 0 comments
Open

DIP <=> pixel conversions in Chromium are wrong #306

bbondy opened this issue Sep 11, 2017 · 0 comments

Comments

@bbondy
Copy link
Member

bbondy commented Sep 11, 2017

Instead of multiplying and dividing by 1.75 for 175% DPI, we should be using PhysicalToLogicalPointForPerMonitorDPI and PhysicalToLogicalPointForPerMonitorDPI
https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx

See also the discussion here:
brave/browser-laptop#8472

Which avoids a conversion to and from DIP when the transformed point does not change. Currently the conversion from and to int points result in the points that can be off by a pixel or 2.

See content/browser/renderer_host/dip_util.cc and gfx::ConvertPointToDIP and gfx::ConvertSizeToPixel

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant