Keep click position in focus on middle-click zoom
ClosedPublic

Authored by muhlenpfordt on Mar 14 2018, 6:27 PM.

Details

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 Ctrl+Scroll.

FEATURE: 308335

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

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
muhlenpfordt requested review of this revision.Mar 14 2018, 6:27 PM
muhlenpfordt created this revision.

The click position is not centered but kept at the same location as it is done with Ctrl+Scroll / Ctrl+Click. This feels more convenient to me than the click location jumping to viewport center as suggested in the bug report.
But maybe there are other opinions to this?

huoni added a subscriber: huoni.Mar 15 2018, 4:45 AM

I strongly agree this is much better. Patch behaves well for me.

rkflx accepted this revision.Mar 15 2018, 11:34 AM
rkflx added a subscriber: rkflx.

@huoni Thanks for testing, I like it too ;)

The patch is so simple and the behaviour so straightforward, yet it took 6 years to fix the bug…

This revision is now accepted and ready to land.Mar 15 2018, 11:34 AM
This revision was automatically updated to reflect the committed changes.