Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong values in retina vs other displays #61

Open
bogus-e opened this issue Apr 28, 2020 · 3 comments
Open

Wrong values in retina vs other displays #61

bogus-e opened this issue Apr 28, 2020 · 3 comments

Comments

@bogus-e
Copy link

bogus-e commented Apr 28, 2020

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Retina displays will always have values double that of regular displays. I am only interested in desktop, as I anticipate mobile is much more difficult.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than zoom-level. Paste the link to your JSFiddle or CodeSandbox example below:
I am looking at https://codesandbox.io/s/zoomlevel-live-example-841ns / https://841ns.csb.app/, as well as testing in the console.

What is the expected behavior?
Ideally a retina display can be identified and its value halved so that retina and non-retina displays give the same value.

Which versions of zoom-level, and which browser / OS / node version are affected by this issue? Did this work in previous versions of zoom-level?
zoom-level: Latest
Browser: Chrome 81.0.4044.122 / FF 75.0
OS: MBP 16 on 10.15.

@xobotyi
Copy link
Owner

xobotyi commented Apr 28, 2020

What numbers do you receive?
Zoom level is not an absolute value thus it does not depend on resolution itself.

@bogus-e
Copy link
Author

bogus-e commented Apr 29, 2020

On my Retina display I got 2x the correct value. I found this snippet, which does not suffer from this problem, but has its own issues. Namely, that it is based on width and so devtools and such can break it.

@xobotyi
Copy link
Owner

xobotyi commented Jul 30, 2022

@bogus-e since i dont have any retina devices - could you please visit this sandbox and check the console of preview https://codesandbox.io/s/zoom-level-live-example-forked-5tygj1?file=/src/index.js
zoom in and out
there will be logs with several values - post them here please

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

No branches or pull requests

2 participants