-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Window.zoomLevel is arbitrary #2023
Comments
I agree, it would be more intuitive. Also you would be able to do something like win.zoomLevel *= 2; to double the zoom level regardless of the current zoom. Right now it seems to be impossible. You can set some number, but it's not clear what is the current zoom level in percentage. |
Well very sad this is not clarified... |
为什么总是自动发邮箱邮件啊 好烦人啊 |
The actual zoom factor = pow(1.2, L) or 1.2^L where L is the zoom level. |
Great thanks. But might it be possible to use a more familiar percentage zoom solution? In my opinion that might be a better option cause css standard also uses percentage. |
in my app i stopped using the application zoom level and replaced it by CSS transitions; this has several advantages:
Since i've implemented this i only use the application zoom to select an initial app zoom state so that a scale of 1 means that 1mm in the CSS approximately matches 1mm on the screen, but even for that an additional factor in the CSS might be used. The only case where application still matters to me is the fact that font and box metrics seem to be more fractional / numerically unstable (?) at small app zoom levels (i have an open question on this problem on http://stackoverflow.com/questions/29035656/why-do-rendered-pixels-differ-from-real-pixels; maybe you people have an idea what's going on?). +1 for app zoom support that uses a scaling factor and supports smooth zooming. Then again, you can easily implement it yourself. |
var zoomPercent = 150;
var win = require("nw.gui").Window.get();
win.zoomLevel = Math.log(zoomPercent/100) / Math.log(1.2); |
Does that mean that the zoom level is the logarithm to base 1.2 of the scaling factor? |
The wiki currently states
It seems to me that "default" should be 1, for 100%. How do I zoom to 150%? Is it 0.5? How do I zoom to 50%, -0.5? Neither would make sense.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: