qView icon indicating copy to clipboard operation
qView copied to clipboard

The mouse wheel zooms in and out of the picture, but the position will move

Open libaineu2004 opened this issue 3 years ago • 2 comments

Environment:

  • OS: [e.g. macOS 10.15 Catalina, Windows 10, Ubuntu 20.04, Arch Linux]
  • qView version: [e.g. 3.0, nightly 2020-05-02.1] OS:Windows10,x64 qView version:3.0

Information: After I opened a jpg picture, I selected a point A on the pixel on the picture. Use the mouse wheel to zoom in on the picture, the mouse position will deviate from point A at this time. That is, the mouse position will change, it is no longer point A, but point B. I hope that when the mouse zooms in and out, the image will always follow the current position for zooming.

libaineu2004 avatar Sep 04 '20 06:09 libaineu2004

Can you upload a video?

jurplel avatar Sep 09 '20 16:09 jurplel

@jurplel Hey, I also have this issue on Windows 10 x64. It happens after using middle click to center the image, as seen on the recording below. Afterwards, scrolling with the mouse wheel often resets the position back to the center. https://user-images.githubusercontent.com/42444745/182455680-beb0718b-4b50-4c5d-bf41-16383277ce65.mp4

BloodRaven0 avatar Aug 02 '22 22:08 BloodRaven0

@BloodRaven0 Do you know if the "Image scaling" setting was unchecked when this happened? If so, I suspect this is related to the "bonus fix" I included in #515.

jdpurcell avatar Dec 04 '22 21:12 jdpurcell

@jdpurcell The video I posted is with the "Image Scaling" disabled. Enabling it seems to fix the problem... for the most part. The only time it would re-center if the image is outzoomed, so it is smaller than the window. It seems there is a check when the image can fit inside the window after zooming, it would center it. This happens regardless of the "Image Scaling" option.

BloodRaven0 avatar Dec 05 '22 21:12 BloodRaven0

@BloodRaven0 Glad to hear my suspicion confirmed.

And yes, the current code intentionally ignores the "zoom towards cursor" setting and forces the image to the center if it's smaller than the window size. I wish it were handled differently; in fact, that's something I changed in my personal qView code. I always have zoom follow the cursor, and re-center it only after zooming stops for a half second when the appropriate setting is enabled. I would gladly submit a pull request if jurplel likes this idea.

https://user-images.githubusercontent.com/6741660/205754713-7352429b-c160-42ac-9f40-efd081e26cd4.mov

Screenshot 2022-12-05 at 5 17 59 PM

jdpurcell avatar Dec 05 '22 22:12 jdpurcell

That's very smooth, I'd like to see that integrated in some way!

jurplel avatar Dec 14 '22 15:12 jurplel

@BloodRaven0 Glad to hear my suspicion confirmed.

And yes, the current code intentionally ignores the "zoom towards cursor" setting and forces the image to the center if it's smaller than the window size. I wish it were handled differently; in fact, that's something I changed in my personal qView code. I always have zoom follow the cursor, and re-center it only after zooming stops for a half second when the appropriate setting is enabled. I would gladly submit a pull request if jurplel likes this idea.

follow.cursor.mov Screenshot 2022-12-05 at 5 17 59 PM

follow.cursor.mov,Yes. The effect of this video demonstration is exactly what I'm trying to convey. That's when the mouse zooms out and zooms in at point A, still staying at point A. Picture scaling, is always the current point of the mouse as the center Please submit a pull request!

libaineu2004 avatar Dec 15 '22 13:12 libaineu2004

This means that the mouse is pointed at A certain pixel in the picture, and the scroll wheel makes the picture zoom in and zoom in, so that the mouse is always at A. And then I zoom in, and then I zoom in, and then I zoom in, and then I zoom in, and then I zoom in, and I'm still at point A.

libaineu2004 avatar Jan 07 '23 14:01 libaineu2004

closing issue since im not clear on its purpose right now

jurplel avatar May 01 '23 19:05 jurplel