Closed Bug 1643097 Opened 4 years ago Closed 4 years ago

Pinch to Zoom on built-in PDF viewer is not a smooth zoom and uses large jump


(Firefox :: PDF Viewer, enhancement)

79 Branch
Windows 10





(Reporter: sraghuvanshi, Assigned: kats)


(Blocks 1 open bug)


User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

I am on Windows 10. I have the following about:config settings enabled: to true
apz.allow_zooming to true

Open a PDF file using the built-in PDF viewer. Then, try to pinch to zoom on a precision trackpad.

Actual results:

The zooming is extremely choppy and laggy, and when it has loaded the document has zoomed by a huge increment.

Expected results:

Compare it to the old Microsoft Edge PDF viewer (not the new Chromium-based Edge), where pinching to zoom in and out is butter-smooth.

OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Blocks: 1568676

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Panning and Zooming
Product: Firefox → Core

We'll likely have to fix in the PDF viewer, across all platforms.

Component: Panning and Zooming → PDF Viewer
Product: Core → Firefox

Related to bug 1625462?

See Also: → 1625462

It's possible that they are related, but bug 1625462 does not occur for me. In particular, when I pinch to zoom on a PDF, the zoom percentage displayed by PDF.js changes, but the UI elements (like the top bar displayed by PDF.js) do not get zoomed as well. Only the PDF content changes.

However, no matter whether I pinch in or out, the PDF zooms in. I cannot ever zoom out using just the trackpad gestures. Should I file a separate bug for that?

I see it on mac too.

No longer blocks: 1568676
Ever confirmed: true
Summary: [Windows] With DirectInput APZ enabled, Pinch to Zoom works poorly on built-in PDF viewer → Pinch to Zoom on built-in PDF viewer is not a smooth zoom and uses large jump

I created Bug 1643461 for the separate issue that I cannot zoom out (only in) using the trackpad.

See Also: → 1643461

Just a note: with apz.allow_zooming enabled, bug 1619187 is what changed the behaviour here from pinch zooming the whole page including the pdf.js controls into this bug.

With apz.allow_zooming disabled we always did the distinct steps zoom, but it gets much more sensitive (ie more zooming with the same physical motion) with apz.allow_zooming enabled.

Presumably pdf.js is listening to ctrl+scrollwheel msgs and the ctrl+scrollwheel msgs we create from pinches have more change in them then the ones that the OS was generating for us? Is that a wider issue that we need to look into outside of just pdf.js?

pdf.js's zooming code was already pretty far out of whack, so I wouldn't use it as a good baseline to check for potential defects in our ctrl+scrollwheel messages. See e.g.

The severity field is not set for this bug.
:bdahl, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(bdahl)
Type: defect → enhancement
Flags: needinfo?(bdahl)

Same on MacOS 10.15.5. Crazy zoom. Can it be fixed ever? Having it since two months. Once apz.allow_zooming enabled and it goes bonkers.

The PR for bug 1392361 should fix this one too.

Assignee: nobody → kats
Depends on: 1392361

Bug reporter here. While I applaud the improvements that the PR for bug 1392361 bring, I still don't think this bug is fixed by that. While the touchpad zoom increment has decreased, it is still not smooth. Try zooming on a PDF in Chrome's builtin PDF viewer or Safari to see what I'm talking about.

Flags: needinfo?(kats)

That's true, this bug is only intended to address the big jump part. The zoom will still be "stepwise" rather than smooth because pdf.js doesn't currently have an easy way to hook up smooth zooming. But the PR will at least reverse any regressions that were caused by the introduction of APZ zooming (i.e. the big jumps in zooming).

Flags: needinfo?(kats)

I filed bug 1659492 to implement a smooth zoom in pdf.js, although I don't plan on working on it in the near future. I'll dupe this bug to that one to avoid confusion since there were two different issues lumped into this one, and one of the issues is getting fixed by bug 1392361.

Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.