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

Improve zooming feature with logarithmic scale #677

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

myQwil
Copy link

@myQwil myQwil commented Oct 3, 2022

Zoom-mode now zooms on a logarithmic scale, and the events for zooming in/out gravitate to powers of 2, such as 50%, 100%, 200%, etc.

The option --zoom-step has been changed to represent the number of zoom steps between powers of 2, with the default being 3 steps.

The number of zoom steps is optional, while the rate of zoom-mode uses a constant rate that is not affected by zoom steps.

Edit: You can also step between powers other than 2. For example, if you want 5 steps between powers of 3, you would enter the raw value of ln(2) / ln(3) * 5 which results in:

--zoom-step=3.154648768

@pepa65
Copy link

pepa65 commented Oct 3, 2022

Excellent idea! I would still like a separate slow-zoom mode, but this is great.

@myQwil
Copy link
Author

myQwil commented Oct 3, 2022

Okay, so I've added another option called --zoom-rate, which allows for different zoom rates in zoom-mode.

While --zoom-steps is the number of button or key presses between powers of 2, --zoom-rate represents the number of pixels between powers of 2 that the user clicks and drags between, so if you added the arg --zoom-rate=1024, it would result in a very slow zoom-mode. The default is 128 pixels.

@avlec
Copy link
Contributor

avlec commented Feb 10, 2023

Thank you for making this better 😄

@myQwil myQwil changed the title Improve zooming feature with natural logarithm Improve zooming feature with logarithmic scale Feb 11, 2023
Zooming now uses a logarithmic scale, and the events for zooming
in/out gravitate to powers of 2, such as 50%, 100%, 200%, etc.

The option `--zoom-step` has been changed to represent the number
of zoom steps between powers of 2, with the default being 3 steps.
While `--zoom-steps` is the number of button or key presses between
powers of 2, `--zoom-rate` represents the number of pixels between
powers of 2 that the user clicks and drags between, so if you added
the arg `--zoom-rate=1024`, it would result in a very slow zoom mode.
The default is 128 pixels.
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

Successfully merging this pull request may close these issues.

3 participants