Bug 429197

Summary: Pinch to zoom is broken. It moves the pdf away from the point where I'm zooming.
Product: [Applications] okular Reporter: Mina <842mono>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED DUPLICATE    
Severity: normal CC: laura.stern, nate, oliver.sander
Priority: NOR Keywords: regression
Version: 1.11.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Mina 2020-11-16 14:29:52 UTC
SUMMARY
After an upgrade to Okular, pinch to zoom (using the touch screen) doesn't work correctly. It moves the pdf away from the point where I'm zooming. It moves it relative to the top left I believe.

This wasn't broken in previous versions of Okular. I don't have the exact version numbers, but this started happening after I did the rebase upgrade of my KDE neon from 18.04 to 20.04. So in 18.04 neon, this didn't happen. In 20.04 neon this happens.

STEPS TO REPRODUCE
1. Pinch to zoom in any pdf.
2. 
3. 

OBSERVED RESULT
Zooming pans the pdf away from the point where I'm zooming.

EXPECTED RESULT
Zooming should work and doesn't pan the pdf while zooming


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: KDE neon 5.20
(available in About System)
KDE Plasma Version: 5.20.1
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2020-11-16 21:12:05 UTC
Can reproduce.

David, do you know if this is one of our known QScroller regressions, or is it unrelated?
Comment 2 Laura David Hurka 2020-11-17 00:11:41 UTC
No, don’t know. A bullet point describing almost this appeared in the QScroller bug list, and Oliver ported a patch for it; but I don’t know how much it is really QScroller related.

Furthermore, I don’t know how to distinguish pinch problems. I never use that.
Comment 3 Oliver Sander 2020-11-17 07:49:33 UTC
The patch is

  https://invent.kde.org/graphics/okular/-/merge_requests/134

In my experience it does fix the problem.  However, David was not happy with the way it is implemented, and I see no reason to question that.

AFAIK the touchscreen part of it is not a QScroller regression.  That didn't work even before the advent of QScroller.
Comment 4 Nate Graham 2020-11-17 16:48:43 UTC

*** This bug has been marked as a duplicate of bug 390707 ***
Comment 5 Nate Graham 2020-11-17 16:54:06 UTC
(In reply to Oliver Sander from comment #3)
> The patch is
> 
>   https://invent.kde.org/graphics/okular/-/merge_requests/134
> 
> In my experience it does fix the problem.  However, David was not happy with
> the way it is implemented, and I see no reason to question that.
Looks like there are various comments that would be addressed to make it merge-ready. FWIW your MR does fix the issue for me, so I would support doing whatever it takes to get it merged.
Comment 6 Laura David Hurka 2020-11-18 10:55:16 UTC
I planned some major changes to PageView scrolling code, so I could implement pinch zooming and scroll zooming in a way I think would be correct.

Until I actually do that, I’m ok with landing !134 after roughly addressing my comments there. It looks like some of my comments can’t be addressed with our current knowledge, so these would need to be skipped. FWIW, this MR fixes the issue for Nate... ;)
Comment 7 Nate Graham 2020-11-19 16:26:17 UTC
It does indeed.
Comment 8 Nate Graham 2021-01-19 15:16:46 UTC

*** This bug has been marked as a duplicate of bug 421755 ***
Comment 9 Nate Graham 2021-01-19 15:55:31 UTC

*** This bug has been marked as a duplicate of bug 159408 ***