Bug 308335 - Wishlist: Middle-click zoom should be centered on the current mouse location
Summary: Wishlist: Middle-click zoom should be centered on the current mouse location
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 2.9.1
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-13 17:33 UTC by Mathieu MD
Modified: 2018-03-15 13:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu MD 2012-10-13 17:33:10 UTC
On an image reduced to fit on my screen, middle-clicking on it will switch the zoom ratio to 100%, and vice-versa if I middle-click once more.
However, the zoom is not centered on where I clicked: it's merely centered on the center of the picture.
It's not the case when I Ctrl+Scroll-Up: the zoom is centered on the mouse position, which is nice.

Reproducible: Always

Steps to Reproduce:
1. Open a big picture and have it reduced to fit your screen;
2. Move your mouse to some point of interest on one of the edges (not in the center) of the picture;
3. Middle-click there;

Actual Results:  
You get the center of the image shown at 100%, not the point of interest you were targeting. You have to click-and-move to go there.

Expected Results:  
The point of interest targeted by the middle-click should have been centered and shown at 100%, not the center of the picture.
Comment 1 Peter Mühlenpfordt 2018-03-15 13:48:01 UTC
Git commit 1e66de8f8f2664451279b23f2e6e7cef3ba372bc by Peter Mühlenpfordt.
Committed on 15/03/2018 at 13:45.
Pushed by muhlenpfordt into branch 'master'.

Keep click position in focus on middle-click zoom

Summary:
Clicking on an image in View Mode with the middle mouse button toggles
between `Fit` and `100%` zoom modes. The image zoomed to `100%` is
always scrolled to the image center.
This patch keeps the clicked location in focus as it is done while
zooming with {key Ctrl Scroll}.

Test Plan:
* Open a big image in View Mode
* Middle-click on different locations over the image
* The `100%` zoom view should keep the clicked location in focus

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Subscribers: rkflx, huoni

Differential Revision: https://phabricator.kde.org/D11336

M  +1    -1    lib/documentview/abstractimageview.cpp

https://commits.kde.org/gwenview/1e66de8f8f2664451279b23f2e6e7cef3ba372bc