feh icon indicating copy to clipboard operation
feh copied to clipboard

Improve zooming feature with logarithmic scale

Open myQwil opened this issue 3 years ago • 3 comments
trafficstars

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

myQwil avatar Oct 03 '22 00:10 myQwil

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

pepa65 avatar Oct 03 '22 00:10 pepa65

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 avatar Oct 03 '22 01:10 myQwil

Thank you for making this better 😄

avlec avatar Feb 10 '23 23:02 avlec