kanryu / quickviewer

A image/comic viewer application for Windows, Mac and Linux, it can show images very fast
https://kanryu.github.io/quickviewer/
GNU General Public License v3.0
536 stars 63 forks source link

Zoom does not retain position #122

Open d-uzlov opened 4 years ago

d-uzlov commented 4 years ago

Disable "Scroll with mouse wheel on zooming" to reproduce. If you zoom in image, so that its size exceeds the size of the program window, top left corner of the image will be enlarged. If you zoom out, the bottom right corner will become more visible.

The majority of the other image viewing programs keep in place either the pixel in the center of the screen, or the pixel under the mouse cursor, which is much more convenient.

kanryu commented 4 years ago

In the case of disable, the display area of the image will not follow the mouse scrolling, so I think that the practicality will not improve much. However, it would be possible to change the display magnification while keeping the center of the display area displayed.

d-uzlov commented 4 years ago

It's all a matter of which pixel keeps its relative position on the screen. As a can see, now QuickViewer keeps position of the top left pixel relative to image canvas. If the image is larger than the window, regardless of whatever image area is visible, if you imagine the point of the top left pixel of the image outside the window, zooming will keep this position. I find it counter-intuitive, just because I can't see the pixel that keeps its position.

Some programs keep position of the pixel in the center. So if the center of the visible area contains a square, and I zoom the image, the square is still in the center.

Pixel that keeps its position can be the pixel under the mouse cursor. So, if the center of the visible area contains a square, and some area under mouse cursor contains a triangle, when I zoom the image, the square will not be in the in the center anymore, but the triangle will remain it's place on the screen, and will just become bigger/smaller. You can see how it works by checking out programs Paint.NET (image editor), Krita (image editor), JpegView (image viewer).

I believe that technically both approaches should work exactly the same way, because if you can make the pixel in the center of the screen keep its place, then you can read the position of the mouse and adjust pixel indices to keep that pixel in place, and then you could even add a little checkbox in settings to switch between them, if you would want to. I personally would be very grateful to see any of the two approaches listed above, either one of them would be much more convenient than the way it works now. Thank you.