Skip to content

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.

@myQwil myQwil force-pushed the natural-zoom branch 2 times, most recently from db83b2f to 10d838e Compare October 4, 2022 19:34
@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
myQwil added 2 commits March 28, 2023 10:37
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